Warning, file /include/Geant4/G4FFGDebuggingMacros.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef G4FFGDEBUGGINGMACROS_HH
0034 #define G4FFGDEBUGGINGMACROS_HH
0035
0036 #include "G4FFGEnumerations.hh"
0037 #include "G4FFGVerboseMacros.hh"
0038 #include "globals.hh"
0039
0040
0041 #if defined(__GNUC__)
0042 # define G4FFG_FUNCTION_SIGNATURE__ G4String(__func__) + "()"
0043 #elif defined(_MSC_VER)
0044
0045 # define G4FFG_FUNCTION_SIGNATURE__ G4String(__FUNCTION__) + "()"
0046 #else
0047 # define G4FFG_FUNCTION_SIGNATURE__ "a function"
0048 #endif
0049
0050
0051 #if defined(G4DEBUG_VERBOSE)
0052
0053
0054
0055 extern G4long G4FFGDEBUG_RECURSIVE_REPRESSION;
0056
0057
0058
0059 extern G4long G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER;
0060
0061
0062
0063 extern G4long G4FFGDEBUG_DATA_STRUCTURE_REPRESSION;
0064
0065
0066
0067 extern G4long G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER;
0068
0069
0070
0071
0072
0073
0074 # define G4FFG_FUNCTIONENTER__ \
0075 if ((Verbosity_ & G4FFGEnumerations::DEBUG) \
0076 && !(Verbosity_ & G4FFGEnumerations::REPRESS_FUNCTION_ENTER_LEAVE_MESSAGES)) \
0077 { \
0078 G4FFG_SPACING__ \
0079 G4cout << "Entering "; \
0080 G4FFG_LOCATION__ \
0081 G4cout << G4endl; \
0082 } \
0083 G4FFG_DEPTH++;
0084
0085
0086
0087
0088
0089
0090 # define G4FFG_SAMPLING_FUNCTIONENTER__ \
0091 if (!(Verbosity_ & G4FFGEnumerations::REPRESS_RANDOM_SAMPLING_MESSAGES)) { \
0092 G4FFG_FUNCTIONENTER__ \
0093 }
0094
0095
0096
0097
0098
0099
0100 # define G4FFG_RECURSIVE_FUNCTIONENTER__ \
0101 if (Verbosity_ & G4FFGEnumerations::REPRESS_RECURSIVE_DEBUG_MESSAGES) { \
0102 if (G4FFGDEBUG_RECURSIVE_REPRESSION == 0) { \
0103 G4FFG_FUNCTIONENTER__ \
0104 } \
0105 else { \
0106 G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER++; \
0107 } \
0108 G4FFGDEBUG_RECURSIVE_REPRESSION++; \
0109 } \
0110 else { \
0111 G4FFG_FUNCTIONENTER__ \
0112 }
0113
0114
0115
0116
0117
0118
0119 # define G4FFG_DATA_FUNCTIONENTER__ \
0120 if (Verbosity_ & G4FFGEnumerations::REPRESS_DATA_STRUCTURE_DEBUG_MESSAGES) { \
0121 if (G4FFGDEBUG_RECURSIVE_REPRESSION == 0) { \
0122 G4FFG_FUNCTIONENTER__ \
0123 } \
0124 else { \
0125 G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER++; \
0126 } \
0127 G4FFGDEBUG_RECURSIVE_REPRESSION++; \
0128 } \
0129 else { \
0130 G4FFG_FUNCTIONENTER__ \
0131 }
0132
0133
0134
0135
0136
0137
0138
0139 # define G4FFG_FUNCTIONLEAVE__ \
0140 G4FFG_DEPTH--; \
0141 if ((Verbosity_ & G4FFGEnumerations::DEBUG) \
0142 && !(Verbosity_ & G4FFGEnumerations::REPRESS_FUNCTION_ENTER_LEAVE_MESSAGES)) \
0143 { \
0144 G4FFG_SPACING__ \
0145 G4cout << "Leaving "; \
0146 G4FFG_LOCATION__ \
0147 G4cout << G4endl; \
0148 }
0149
0150
0151
0152
0153
0154
0155 # define G4FFG_SAMPLING_FUNCTIONLEAVE__ \
0156 if (!(Verbosity_ & G4FFGEnumerations::REPRESS_RANDOM_SAMPLING_MESSAGES)) { \
0157 G4FFG_FUNCTIONLEAVE__ \
0158 }
0159
0160
0161
0162
0163
0164
0165 # define G4FFG_RECURSIVE_FUNCTIONLEAVE__ \
0166 if (Verbosity_ & G4FFGEnumerations::REPRESS_RECURSIVE_DEBUG_MESSAGES) { \
0167 G4FFGDEBUG_RECURSIVE_REPRESSION--; \
0168 if (G4FFGDEBUG_RECURSIVE_REPRESSION == 0) { \
0169 if (G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER > 0) { \
0170 G4FFG_SPACING__ \
0171 G4cout << "==== " << G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER * 2 \
0172 << " recursive function messages suppressed ====" << G4endl; \
0173 G4FFGDEBUG_RECURSIVE_REPRESSION_COUNTER = 0; \
0174 } \
0175 G4FFG_FUNCTIONLEAVE__ \
0176 } \
0177 } \
0178 else { \
0179 G4FFG_FUNCTIONLEAVE__ \
0180 }
0181
0182
0183
0184
0185
0186
0187 # define G4FFG_DATA_FUNCTIONLEAVE__ \
0188 if (Verbosity_ & G4FFGEnumerations::REPRESS_DATA_STRUCTURE_DEBUG_MESSAGES) { \
0189 G4FFGDEBUG_RECURSIVE_REPRESSION--; \
0190 if (G4FFGDEBUG_RECURSIVE_REPRESSION == 0) { \
0191 if (G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER > 0) { \
0192 G4FFG_SPACING__ \
0193 G4cout << "==== " << G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER * 2 \
0194 << " data structure function messages suppressed ====" << G4endl; \
0195 G4FFGDEBUG_DATA_STRUCTURE_REPRESSION_COUNTER = 0; \
0196 } \
0197 G4FFG_FUNCTIONLEAVE__ \
0198 } \
0199 } \
0200 else { \
0201 G4FFG_FUNCTIONLEAVE__ \
0202 }
0203 #else
0204
0205
0206
0207 # define G4FFG_FUNCTIONENTER__ G4FFG_DEPTH++;
0208 # define G4FFG_SAMPLING_FUNCTIONENTER__
0209 # define G4FFG_RECURSIVE_FUNCTIONENTER__
0210 # define G4FFG_DATA_FUNCTIONENTER__
0211 # define G4FFG_FUNCTIONLEAVE__ G4FFG_DEPTH--;
0212 # define G4FFG_SAMPLING_FUNCTIONLEAVE__
0213 # define G4FFG_RECURSIVE_FUNCTIONLEAVE__
0214 # define G4FFG_DATA_FUNCTIONLEAVE__
0215 #endif
0216
0217 #endif