33#ifndef G4FFGDEBUGGINGMACROS_HH
34#define G4FFGDEBUGGINGMACROS_HH
42# define G4FFG_FUNCTION_SIGNATURE__ G4String(__func__) + "()"
43#elif defined(_MSC_VER)
45# define G4FFG_FUNCTION_SIGNATURE__ G4String(__FUNCTION__) + "()"
47# define G4FFG_FUNCTION_SIGNATURE__ "a function"
51#if defined(G4DEBUG_VERBOSE)
55extern G4long G4FFGDEBUG_RECURSIVE_REPRESSION;
59extern G4long G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER;
63extern G4long G4FFGDEBUG_DATA_STRUCTURE_REPRESSION;
67extern G4long G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER;
74# define G4FFG_FUNCTIONENTER__ \
75 if ((Verbosity_ & G4FFGEnumerations::DEBUG) \
76 && !(Verbosity_ & G4FFGEnumerations::REPRESS_FUNCTION_ENTER_LEAVE_MESSAGES)) \
79 G4cout << "Entering "; \
90# define G4FFG_SAMPLING_FUNCTIONENTER__ \
91 if (!(Verbosity_ & G4FFGEnumerations::REPRESS_RANDOM_SAMPLING_MESSAGES)) { \
92 G4FFG_FUNCTIONENTER__ \
100# define G4FFG_RECURSIVE_FUNCTIONENTER__ \
101 if (Verbosity_ & G4FFGEnumerations::REPRESS_RECURSIVE_DEBUG_MESSAGES) { \
102 if (G4FFGDEBUG_RECURSIVE_REPRESSION == 0) { \
103 G4FFG_FUNCTIONENTER__ \
106 G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER++; \
108 G4FFGDEBUG_RECURSIVE_REPRESSION++; \
111 G4FFG_FUNCTIONENTER__ \
119# define G4FFG_DATA_FUNCTIONENTER__ \
120 if (Verbosity_ & G4FFGEnumerations::REPRESS_DATA_STRUCTURE_DEBUG_MESSAGES) { \
121 if (G4FFGDEBUG_RECURSIVE_REPRESSION == 0) { \
122 G4FFG_FUNCTIONENTER__ \
125 G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER++; \
127 G4FFGDEBUG_RECURSIVE_REPRESSION++; \
130 G4FFG_FUNCTIONENTER__ \
139# define G4FFG_FUNCTIONLEAVE__ \
141 if ((Verbosity_ & G4FFGEnumerations::DEBUG) \
142 && !(Verbosity_ & G4FFGEnumerations::REPRESS_FUNCTION_ENTER_LEAVE_MESSAGES)) \
145 G4cout << "Leaving "; \
155# define G4FFG_SAMPLING_FUNCTIONLEAVE__ \
156 if (!(Verbosity_ & G4FFGEnumerations::REPRESS_RANDOM_SAMPLING_MESSAGES)) { \
157 G4FFG_FUNCTIONLEAVE__ \
165# define G4FFG_RECURSIVE_FUNCTIONLEAVE__ \
166 if (Verbosity_ & G4FFGEnumerations::REPRESS_RECURSIVE_DEBUG_MESSAGES) { \
167 G4FFGDEBUG_RECURSIVE_REPRESSION--; \
168 if (G4FFGDEBUG_RECURSIVE_REPRESSION == 0) { \
169 if (G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER > 0) { \
171 G4cout << "==== " << G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER * 2 \
172 << " recursive function messages suppressed ====" << G4endl; \
173 G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER = 0; \
175 G4FFG_FUNCTIONLEAVE__ \
179 G4FFG_FUNCTIONLEAVE__ \
187# define G4FFG_DATA_FUNCTIONLEAVE__ \
188 if (Verbosity_ & G4FFGEnumerations::REPRESS_DATA_STRUCTURE_DEBUG_MESSAGES) { \
189 G4FFGDEBUG_RECURSIVE_REPRESSION--; \
190 if (G4FFGDEBUG_RECURSIVE_REPRESSION == 0) { \
191 if (G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER > 0) { \
193 G4cout << "==== " << G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER * 2 \
194 << " data structure function messages suppressed ====" << G4endl; \
195 G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER = 0; \
197 G4FFG_FUNCTIONLEAVE__ \
201 G4FFG_FUNCTIONLEAVE__ \
207# define G4FFG_FUNCTIONENTER__ G4FFG_DEPTH++;
208# define G4FFG_SAMPLING_FUNCTIONENTER__
209# define G4FFG_RECURSIVE_FUNCTIONENTER__
210# define G4FFG_DATA_FUNCTIONENTER__
211# define G4FFG_FUNCTIONLEAVE__ G4FFG_DEPTH--;
212# define G4FFG_SAMPLING_FUNCTIONLEAVE__
213# define G4FFG_RECURSIVE_FUNCTIONLEAVE__
214# define G4FFG_DATA_FUNCTIONLEAVE__