searchui/inc/search_global.h
changeset 9 4a2987baf8f7
child 15 df6898e696c6
equal deleted inserted replaced
8:2f67eb14d003 9:4a2987baf8f7
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  The dll header file.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SEARCH_GLOBAL_H
       
    20 #define SEARCH_GLOBAL_H
       
    21 
       
    22 #include <qdebug.h>
       
    23 
       
    24 #ifdef NFT
       
    25 #ifdef Q_OS_SYMBIAN
       
    26 #include <e32hal.h>
       
    27 #endif
       
    28 #endif
       
    29 //#define OST_TRACE_COMPILER_IN_USE //Uncomment to enable performance measurements.
       
    30 
       
    31 #ifdef OST_TRACE_COMPILER_IN_USE
       
    32 #define PERF_APP_LAUNCH_END(str) qDebug() << "Search_App_Launch :"<<str<<"at:"<<QTime::currentTime().second()<<":"<<QTime::currentTime().msec();
       
    33 #else
       
    34 #define PERF_APP_LAUNCH_END(str)
       
    35 #endif 
       
    36 
       
    37 #ifndef SEARCH_UNITTESTING
       
    38     #define SEARCH_CLASS(aClassName)
       
    39 #else
       
    40     #define SEARCH_CLASS(aClassName) class aClassName;
       
    41 #endif 
       
    42 
       
    43 #ifndef SEARCH_UNITTESTING
       
    44     #define SEARCH_FRIEND_CLASS(aClassName)
       
    45 #else
       
    46     #define SEARCH_FRIEND_CLASS(aClassName) friend class aClassName;
       
    47 #endif 
       
    48 
       
    49 #define SEARCHCATCHDEBUG qDebug("Catched in: %s on line: %d",__FILE__,__LINE__);
       
    50 #define SEARCHDEBUG(a) qDebug("%s in: %s on line: %d", (a),  __FILE__,__LINE__);
       
    51 
       
    52 #ifdef NFT
       
    53     #define SEARCHTEST(aText)                  qDebug() << QString(aText)
       
    54 #ifdef Q_OS_SYMBIAN
       
    55     inline void SEARCHFreeRam(const QString &aFunction)
       
    56     {
       
    57     TMemoryInfoV1Buf meminfo;
       
    58     UserHal::MemoryInfo(meminfo);
       
    59     int memSize = meminfo().iTotalRamInBytes >> 10;
       
    60     int memFree = meminfo().iFreeRamInBytes >> 10;
       
    61 
       
    62     RHeap& ownHeap = User::Heap();
       
    63     TInt biggestBlock = 0;
       
    64     int heapFree = ownHeap.Available(biggestBlock) >> 10;
       
    65     int heapSize = ownHeap.Size() >> 10;
       
    66     qDebug()<< aFunction << "memFree" << memFree << "kb memSize" << memSize << "kb heapFree" << heapFree << "kb heapSize" << heapSize;
       
    67     }
       
    68     
       
    69     #define SEARCH_FUNC_ENTRY(aFunction)   SEARCHFreeRam(QString(aFunction)+" entry")
       
    70     #define SEARCH_FUNC_EXIT(aFunction)    SEARCHFreeRam(QString(aFunction)+" exit")
       
    71 #else
       
    72     #define SEARCH_FUNC_ENTRY(aFunction)   qDebug()<< aFunction << " entry";
       
    73     #define SEARCH_FUNC_EXIT(aFunction)    qDebug()<< aFunction << " exit";
       
    74 #endif
       
    75     
       
    76 #else
       
    77     #define SEARCHTEST(aText)
       
    78     #define SEARCH_FUNC_ENTRY(aFunction)
       
    79     #define SEARCH_FUNC_EXIT(aFunction)
       
    80 #endif
       
    81 
       
    82 #endif // SEARCH_GLOBAL_H
       
    83