scaffold  1.0.0
Generates files and directories based on templates and user input
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
${ PRJ.UNIXNAME }_debug.h
1 /* ========================================================================= */
2 /* ------------------------------------------------------------------------- *//*
11 
12 
13  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14  Please read COPYING and README files in root folder
15  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 */
17 /* ------------------------------------------------------------------------- */
18 /* ========================================================================= */
19 #ifndef __{% String( PRJ.UNIXNAME ).toUpperCase() %}_DEBUG_INC__
20 #define __{% String( PRJ.UNIXNAME ).toUpperCase() %}_DEBUG_INC__
21 //
22 //
23 //
24 //
25 /* INCLUDES ------------------------------------------------------------ */
26 
27 /* we make sure we have the user settings before this file */
28 #include <{% PRJ.UNIXNAME %}/{% PRJ.UNIXNAME %}_global.h>
29 #include <{% PRJ.UNIXNAME %}/{% PRJ.UNIXNAME %}_config.h>
30 
31 /* INCLUDES ============================================================ */
32 //
33 //
34 //
35 //
36 /* DEFINITIONS --------------------------------------------------------- */
37 
38 
48 enum {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG_Codes {
49  {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG_CTORDTOR,
50  {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG_V_CTORDTOR,
51  {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG_LIBRARY,
53  {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG_MAX
54 };
55 
56 /* by default enable logging in debug builds */
57 #ifndef {% String( PRJ.UNIXNAME ).toUpperCase() %}_ENABLE_LOGGING
58 # ifndef QT_NO_DEBUG
59 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}_ENABLE_LOGGING 1
60 # else
61 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}_ENABLE_LOGGING 0
62 # endif
63 #endif
64 
65 #if {% String( PRJ.UNIXNAME ).toUpperCase() %}_ENABLE_LOGGING
66 # include <QDebug>
67 
68 /* IS_{% String( PRJ.UNIXNAME ).toUpperCase() %}_DEBUG_ID_ALLOWED should be defined in {% String( PRJ.UNIXNAME ).toUpperCase() %}_config.h */
69 #ifndef IS_{% String( PRJ.UNIXNAME ).toUpperCase() %}_DEBUG_ID_ALLOWED
70 # define IS_{% String( PRJ.UNIXNAME ).toUpperCase() %}_DEBUG_ID_ALLOWED( id ) false
71 #endif
72 
73 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG(id,txt) \
74  if ( IS_{% String( PRJ.UNIXNAME ).toUpperCase() %}_DEBUG_ID_ALLOWED( id ) ) \
75  qDebug() << bbb::debugName(id) << ": " << txt
76 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG2(id,txt1,txt2) \
77  if ( IS_{% String( PRJ.UNIXNAME ).toUpperCase() %}_DEBUG_ID_ALLOWED( id ) ) \
78  qDebug() << bbb::debugName(id) << ": " << txt1 << txt2
79 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG3(id,txt1,txt2,txt3) \
80  if ( IS_{% String( PRJ.UNIXNAME ).toUpperCase() %}_DEBUG_ID_ALLOWED( id ) ) \
81  qDebug() << bbb::debugName(id) << ": " << txt1 << txt2 << txt3
82 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG_FUNC(id) {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG(id, __func__ )
83 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG_CDTOR {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG2({% String( PRJ.UNIXNAME ).toUpperCase() %}DBG_CTORDTOR, __func__, this )
84 #else
85 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG(id,txt)
86 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG2(id,txt1,txt2)
87 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG3(id,txt1,txt2,txt3)
88 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG_FUNC(id)
89 # define {% String( PRJ.UNIXNAME ).toUpperCase() %}DBG_CDTOR
90 #endif
91 
92 /* DEFINITIONS ========================================================= */
93 //
94 //
95 //
96 //
97 /* DATA ---------------------------------------------------------------- */
98 
99 /* DATA ================================================================ */
100 //
101 //
102 //
103 //
104 /* FUNCTIONS ----------------------------------------------------------- */
105 
106 namespace bbb {
107 #ifndef QT_NO_DEBUG
108 {% String( PRJ.UNIXNAME ).toUpperCase() %}SHARED_EXPORT const char * debugName ( int i );
109 #endif
110 }
111 
112 /* FUNCTIONS =========================================================== */
113 //
114 //
115 //
116 //
117 #endif // __{% String( PRJ.UNIXNAME ).toUpperCase() %}_DEBUG_INC__
118 /* ------------------------------------------------------------------------- */
119 /* ========================================================================= */