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 |
|
30 #ifndef SEARCH_UNITTESTING |
|
31 #define SEARCH_CLASS(aClassName) |
|
32 #else |
|
33 #define SEARCH_CLASS(aClassName) class aClassName; |
|
34 #endif |
|
35 |
|
36 #ifndef SEARCH_UNITTESTING |
|
37 #define SEARCH_FRIEND_CLASS(aClassName) |
|
38 #else |
|
39 #define SEARCH_FRIEND_CLASS(aClassName) friend class aClassName; |
|
40 #endif |
|
41 |
|
42 #define SEARCHCATCHDEBUG qDebug("Catched in: %s on line: %d",__FILE__,__LINE__); |
|
43 #define SEARCHDEBUG(a) qDebug("%s in: %s on line: %d", (a), __FILE__,__LINE__); |
|
44 |
|
45 #ifdef NFT |
|
46 #define SEARCHTEST(aText) qDebug() << QString(aText) |
|
47 #ifdef Q_OS_SYMBIAN |
|
48 inline void SEARCHFreeRam(const QString &aFunction) |
|
49 { |
|
50 TMemoryInfoV1Buf meminfo; |
|
51 UserHal::MemoryInfo(meminfo); |
|
52 int memSize = meminfo().iTotalRamInBytes >> 10; |
|
53 int memFree = meminfo().iFreeRamInBytes >> 10; |
|
54 |
|
55 RHeap& ownHeap = User::Heap(); |
|
56 TInt biggestBlock = 0; |
|
57 int heapFree = ownHeap.Available(biggestBlock) >> 10; |
|
58 int heapSize = ownHeap.Size() >> 10; |
|
59 qDebug()<< aFunction << "memFree" << memFree << "kb memSize" << memSize << "kb heapFree" << heapFree << "kb heapSize" << heapSize; |
|
60 } |
|
61 |
|
62 #define SEARCH_FUNC_ENTRY(aFunction) SEARCHFreeRam(QString(aFunction)+" entry") |
|
63 #define SEARCH_FUNC_EXIT(aFunction) SEARCHFreeRam(QString(aFunction)+" exit") |
|
64 #else |
|
65 #define SEARCH_FUNC_ENTRY(aFunction) qDebug()<< aFunction << " entry"; |
|
66 #define SEARCH_FUNC_EXIT(aFunction) qDebug()<< aFunction << " exit"; |
|
67 #endif |
|
68 |
|
69 #else |
|
70 #define SEARCHTEST(aText) |
|
71 #define SEARCH_FUNC_ENTRY(aFunction) |
|
72 #define SEARCH_FUNC_EXIT(aFunction) |
|
73 #endif |
|
74 |
|
75 #endif // SEARCH_GLOBAL_H |
|
76 |
|