33 #ifndef G4FFGDEBUGGINGMACROS_HH
34 #define G4FFGDEBUGGINGMACROS_HH
43 #define G4FFG_FUNCTION_SIGNATURE__ G4String(__func__) + "()"
44 #elif defined(_MSC_VER)
46 #define G4FFG_FUNCTION_SIGNATURE__ G4String(__FUNCTION__) + "()"
48 #define G4FFG_FUNCTION_SIGNATURE__ "a function"
52 #if defined(G4DEBUG_VERBOSE)
56 extern G4long G4FFGDEBUG_RECURSIVE_REPRESSION;
60 extern G4long G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER;
64 extern G4long G4FFGDEBUG_DATA_STRUCTURE_REPRESSION;
68 extern G4long G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER;
75 #define G4FFG_FUNCTIONENTER__ \
76 if((Verbosity_ & G4FFGEnumerations::DEBUG) && !(Verbosity_ & G4FFGEnumerations::REPRESS_FUNCTION_ENTER_LEAVE_MESSAGES)) \
79 G4cout << "Entering ";\
90 #define G4FFG_SAMPLING_FUNCTIONENTER__ \
91 if(!(Verbosity_ & G4FFGEnumerations::REPRESS_RANDOM_SAMPLING_MESSAGES)) \
93 G4FFG_FUNCTIONENTER__ \
101 #define G4FFG_RECURSIVE_FUNCTIONENTER__ \
102 if(Verbosity_ & G4FFGEnumerations::REPRESS_RECURSIVE_DEBUG_MESSAGES)\
104 if(G4FFGDEBUG_RECURSIVE_REPRESSION == 0) \
106 G4FFG_FUNCTIONENTER__ \
109 G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER++; \
111 G4FFGDEBUG_RECURSIVE_REPRESSION++; \
114 G4FFG_FUNCTIONENTER__ \
122 #define G4FFG_DATA_FUNCTIONENTER__ \
123 if(Verbosity_ & G4FFGEnumerations::REPRESS_DATA_STRUCTURE_DEBUG_MESSAGES)\
125 if(G4FFGDEBUG_RECURSIVE_REPRESSION == 0) \
127 G4FFG_FUNCTIONENTER__ \
130 G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER++; \
132 G4FFGDEBUG_RECURSIVE_REPRESSION++; \
135 G4FFG_FUNCTIONENTER__ \
144 #define G4FFG_FUNCTIONLEAVE__ \
146 if((Verbosity_ & G4FFGEnumerations::DEBUG) && !(Verbosity_ & G4FFGEnumerations::REPRESS_FUNCTION_ENTER_LEAVE_MESSAGES)) \
149 G4cout << "Leaving ";\
159 #define G4FFG_SAMPLING_FUNCTIONLEAVE__ \
160 if(!(Verbosity_ & G4FFGEnumerations::REPRESS_RANDOM_SAMPLING_MESSAGES)) \
162 G4FFG_FUNCTIONLEAVE__ \
170 #define G4FFG_RECURSIVE_FUNCTIONLEAVE__ \
171 if(Verbosity_ & G4FFGEnumerations::REPRESS_RECURSIVE_DEBUG_MESSAGES)\
173 G4FFGDEBUG_RECURSIVE_REPRESSION--; \
174 if(G4FFGDEBUG_RECURSIVE_REPRESSION == 0) \
176 if(G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER > 0) \
179 G4cout << "==== " << G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER * 2 << " recursive function messages suppressed ====" << G4endl; \
180 G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER = 0; \
182 G4FFG_FUNCTIONLEAVE__ \
186 G4FFG_FUNCTIONLEAVE__ \
194 #define G4FFG_DATA_FUNCTIONLEAVE__ \
195 if(Verbosity_ & G4FFGEnumerations::REPRESS_DATA_STRUCTURE_DEBUG_MESSAGES)\
197 G4FFGDEBUG_RECURSIVE_REPRESSION--; \
198 if(G4FFGDEBUG_RECURSIVE_REPRESSION == 0) \
200 if(G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER > 0) \
203 G4cout << "==== " << G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER * 2 << " data structure function messages suppressed ====" << G4endl; \
204 G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER = 0; \
206 G4FFG_FUNCTIONLEAVE__ \
210 G4FFG_FUNCTIONLEAVE__ \
215 #define G4FFG_FUNCTIONENTER__ G4FFG_DEPTH++;
216 #define G4FFG_SAMPLING_FUNCTIONENTER__
217 #define G4FFG_RECURSIVE_FUNCTIONENTER__
218 #define G4FFG_DATA_FUNCTIONENTER__
219 #define G4FFG_FUNCTIONLEAVE__ G4FFG_DEPTH--;
220 #define G4FFG_SAMPLING_FUNCTIONLEAVE__
221 #define G4FFG_RECURSIVE_FUNCTIONLEAVE__
222 #define G4FFG_DATA_FUNCTIONLEAVE__