27#ifdef USE_BOOST_MULTITHREADING
28#include "boost/thread/mutex.hpp"
44#define stackprt(stream) stream << FunNameStack::instance()
47#define mfunname(string) \
48 static char* FunNameIIII = string; \
49 FunNameWatch funnw(FunNameIIII)
50#define mfunname1(string) \
51 static char* FunNameIIII1 = string; \
52 FunNameWatch funnw1(FunNameIIII1)
53#define mfunname2(string) \
54 static char* FunNameIIII2 = string; \
55 FunNameWatch funnw2(FunNameIIII2)
56#define mfunname3(string) \
57 static char* FunNameIIII3 = string; \
58 FunNameWatch funnw3(FunNameIIII3)
59#define mfunname4(string) \
60 static char* FunNameIIII4 = string; \
61 FunNameWatch funnw4(FunNameIIII4)
62#define mfunname5(string) \
63 static char* FunNameIIII5 = string; \
64 FunNameWatch funnw5(FunNameIIII5)
67#define mfunname(string)
68#define mfunname1(string)
69#define mfunname2(string)
70#define mfunname3(string)
71#define mfunname4(string)
72#define mfunname5(string)
77#define mfunnamep(string) \
78 static const char* FunNameIIII = string; \
79 FunNameWatch funnw(FunNameIIII)
80#define mfunnamep1(string) \
81 static const char* FunNameIIII1 = string; \
82 FunNameWatch funnw1(FunNameIIII1)
83#define mfunnamep2(string) \
84 static const char* FunNameIIII2 = string; \
85 FunNameWatch funnw2(FunNameIIII2)
86#define mfunnamep3(string) \
87 static const char* FunNameIIII3 = string; \
88 FunNameWatch funnw3(FunNameIIII3)
89#define mfunnamep4(string) \
90 static const char* FunNameIIII4 = string; \
91 FunNameWatch funnw4(FunNameIIII4)
92#define mfunnamep5(string) \
93 static const char* FunNameIIII5 = string; \
94 FunNameWatch funnw5(FunNameIIII5)
102#define check_econd(condition, add, stream) \
104 funnw.ehdr(stream); \
105 stream << '\n' << #condition << '\n'; \
109#define check_wcond(condition, add, stream) \
111 funnw.whdr(stream); \
112 stream << '\n' << #condition << '\n'; \
116#define check_econd1(condition, a1, stream) \
118 funnw.ehdr(stream); \
119 stream << '\n' << #condition << '\n'; \
120 stream << #a1 << '=' << (a1) << '\n'; \
123#define check_wcond1(condition, a1, stream) \
125 funnw.whdr(stream); \
126 stream << '\n' << #condition << '\n'; \
127 stream << #a1 << '=' << (a1) << '\n'; \
130#define check_econd2(condition, a1, a2, stream) \
132 funnw.ehdr(stream); \
133 stream << '\n' << #condition << '\n'; \
134 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << '\n'; \
137#define check_wcond2(condition, a1, a2, stream) \
139 funnw.whdr(stream); \
140 stream << '\n' << #condition << '\n'; \
141 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << '\n'; \
144#define check_econd3(condition, a1, a2, a3, stream) \
146 funnw.ehdr(stream); \
147 stream << '\n' << #condition << '\n'; \
148 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << ' ' << #a3 \
149 << '=' << (a3) << '\n'; \
152#define check_wcond3(condition, a1, a2, a3, stream) \
154 funnw.whdr(stream); \
155 stream << '\n' << #condition << '\n'; \
156 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << ' ' << #a3 \
157 << '=' << (a3) << '\n'; \
160#define check_econd4(condition, a1, a2, a3, a4, stream) \
162 funnw.ehdr(stream); \
163 stream << '\n' << #condition << '\n'; \
164 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << ' ' << #a3 \
165 << '=' << (a3) << ' ' << #a4 << '=' << (a4) << '\n'; \
168#define check_wcond4(condition, a1, a2, a3, a4, stream) \
170 funnw.whdr(stream); \
171 stream << '\n' << #condition << '\n'; \
172 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << ' ' << #a3 \
173 << '=' << (a3) << ' ' << #a4 << '=' << (a4) << '\n'; \
176#define check_econd11(a, signb, stream) \
178 funnw.ehdr(stream); \
179 stream << '\n' << #a << #signb << '\n'; \
180 stream << #a << '=' << (a) << '\n'; \
183#define check_wcond11(a, signb, stream) \
185 funnw.whdr(stream); \
186 stream << '\n' << #a << #signb << '\n'; \
187 stream << #a << '=' << (a) << '\n'; \
190#define check_econd12(a, sign, b, stream) \
192 funnw.ehdr(stream); \
193 stream << '\n' << #a << #sign << #b << '\n'; \
194 stream << #a << '=' << (a) << ' ' << #b << '=' << (b) << '\n'; \
197#define check_wcond12(a, sign, b, stream) \
199 funnw.whdr(stream); \
200 stream << '\n' << #a << #sign << #b << '\n'; \
201 stream << #a << '=' << (a) << ' ' << #b << '=' << (b) << '\n'; \
205#define check_econd11a(a, signb, add, stream) \
207 funnw.ehdr(stream); \
208 stream << '\n' << #a << #signb << '\n'; \
209 stream << #a << '=' << (a) << '\n'; \
213#define check_wcond11a(a, signb, add, stream) \
215 funnw.whdr(stream); \
216 stream << '\n' << #a << #signb << '\n'; \
217 stream << #a << '=' << (a) << '\n'; \
221#define check_econd12a(a, sign, b, add, stream) \
223 funnw.ehdr(stream); \
224 stream << '\n' << #a << #sign << #b << '\n'; \
225 stream << #a << '=' << (a) << ' ' << #b << '=' << (b) << '\n'; \
229#define check_wcond12a(a, sign, b, add, stream) \
231 funnw.whdr(stream); \
232 stream << '\n' << #a << #sign << #b << '\n'; \
233 stream << #a << '=' << (a) << ' ' << #b << '=' << (b) << '\n'; \
238#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream) \
239 if(a sign1_b1_sign0 a sign2_b2) { \
240 funnw.ehdr(stream); \
241 stream << '\n' << #a << #sign1_b1_sign0 << #a << #sign2_b2 << '\n'; \
242 stream << #a << '=' << (a) << '\n'; \
245#define check_wcond21(a, sign1_b1_sign0, sign2_b2, stream) \
246 if(a sign1_b1_sign0 a sign2_b2) { \
247 funnw.whdr(stream); \
248 stream << '\n' << #a << #sign1_b1_sign0 << #a << #sign2_b2 << '\n'; \
249 stream << #a << '=' << (a) << '\n'; \
253#define check_econd23(a, sign1, b1, sign0, sign2, b2, stream) \
254 if(a sign1 b1 sign0 a sign2 b2) { \
255 funnw.ehdr(stream); \
256 stream << '\n' << #a << #sign1 << #b1 << #sign0 << #a << #sign2 << #b2 \
258 stream << #a << '=' << (a) << ' ' << #b1 << '=' << (b1) << ' ' << #b2 \
259 << '=' << (b2) << '\n'; \
262#define check_wcond23(a, sign1, b1, sign0, sign2, b2, stream) \
263 if(a sign1 b1 sign0 a sign2 b2) { \
264 funnw.whdr(stream); \
265 stream << '\n' << #a << #sign1 << #b1 << #sign0 << #a << #sign2 << #b2 \
267 stream << #a << '=' << (a) << ' ' << #b1 << '=' << (b1) << ' ' << #b2 \
268 << '=' << (b2) << '\n'; \
272#define check_econd24(a1, sign1, b1, sign0, a2, sign2, b2, stream) \
273 if(a1 sign1 b1 sign0 a2 sign2 b2) { \
274 funnw.ehdr(stream); \
275 stream << '\n' << #a1 << #sign1 << #b1 << #sign0 << #a2 << #sign2 << #b2 \
277 stream << #a1 << '=' << (a1) << ' ' << #b1 << '=' << (b1) << '\n'; \
278 stream << #a2 << '=' << (a2) << ' ' << #b2 << '=' << (b2) << '\n'; \
281#define check_wcond24(a1, sign1, b1, sign0, a2, sign2, b2, stream) \
282 if(a1 sign1 b1 sign0 a2 sign2 b2) { \
283 funnw.whdr(stream); \
284 stream << '\n' << #a1 << #sign1 << #b1 << #sign0 << #a2 << #sign2 << #b2 \
286 stream << #a1 << '=' << (a1) << ' ' << #b1 << '=' << (b1) << '\n'; \
287 stream << #a2 << '=' << (a2) << ' ' << #b2 << '=' << (b2) << '\n'; \
292#define check_econd(condition, add, stream) \
294 stream << "ERROR:\n"; \
295 stream << '\n' << #condition << '\n'; \
299#define check_wcond(condition, add, stream) \
301 stream << "WARNING:\n"; \
302 stream << '\n' << #condition << '\n'; \
306#define check_econd1(condition, a1, stream) \
308 stream << "ERROR:\n"; \
309 stream << '\n' << #condition << '\n'; \
310 stream << #a1 << '=' << (a1) << '\n'; \
313#define check_wcond1(condition, a1, stream) \
315 stream << "WARNING:\n"; \
316 stream << '\n' << #condition << '\n'; \
317 stream << #a1 << '=' << (a1) << '\n'; \
320#define check_econd2(condition, a1, a2, stream) \
322 stream << "ERROR:\n"; \
323 stream << '\n' << #condition << '\n'; \
324 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << '\n'; \
327#define check_wcond2(condition, a1, a2, stream) \
329 stream << "WARNING:\n"; \
330 stream << '\n' << #condition << '\n'; \
331 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << '\n'; \
334#define check_econd3(condition, a1, a2, a3, stream) \
336 stream << "ERROR:\n"; \
337 stream << '\n' << #condition << '\n'; \
338 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << ' ' << #a3 \
339 << '=' << (a3) << '\n'; \
342#define check_wcond3(condition, a1, a2, a3, stream) \
344 stream << "WARNING:\n"; \
345 stream << '\n' << #condition << '\n'; \
346 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << ' ' << #a3 \
347 << '=' << (a3) << '\n'; \
350#define check_econd4(condition, a1, a2, a3, a4, stream) \
352 stream << "ERROR:\n"; \
353 stream << '\n' << #condition << '\n'; \
354 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << ' ' << #a3 \
355 << '=' << (a3) << ' ' << #a4 << '=' << (a4) << '\n'; \
358#define check_wcond4(condition, a1, a2, a3, a4, stream) \
360 stream << "WARNING:\n"; \
361 stream << '\n' << #condition << '\n'; \
362 stream << #a1 << '=' << (a1) << ' ' << #a2 << '=' << (a2) << ' ' << #a3 \
363 << '=' << (a3) << ' ' << #a4 << '=' << (a4) << '\n'; \
366#define check_econd11(a, signb, stream) \
368 stream << "ERROR:\n"; \
369 stream << '\n' << #a << #signb << '\n'; \
370 stream << #a << '=' << (a) << '\n'; \
373#define check_wcond11(a, signb, stream) \
375 stream << "WARNING:\n"; \
376 stream << '\n' << #a << #signb << '\n'; \
377 stream << #a << '=' << (a) << '\n'; \
380#define check_econd12(a, sign, b, stream) \
382 stream << "ERROR:\n"; \
383 stream << '\n' << #a << #sign << #b << '\n'; \
384 stream << #a << '=' << (a) << ' ' << #b << '=' << (b) << '\n'; \
387#define check_wcond12(a, sign, b, stream) \
389 stream << "WARNING:\n"; \
390 stream << '\n' << #a << #sign << #b << '\n'; \
391 stream << #a << '=' << (a) << ' ' << #b << '=' << (b) << '\n'; \
395#define check_econd11a(a, signb, add, stream) \
397 stream << "ERROR:\n"; \
398 stream << '\n' << #a << #signb << '\n'; \
399 stream << #a << '=' << (a) << '\n'; \
403#define check_wcond11a(a, signb, add, stream) \
405 stream << "WARNING:\n"; \
406 stream << '\n' << #a << #signb << '\n'; \
407 stream << #a << '=' << (a) << '\n'; \
411#define check_econd12a(a, sign, b, add, stream) \
413 stream << "ERROR:\n"; \
414 stream << '\n' << #a << #sign << #b << '\n'; \
415 stream << #a << '=' << (a) << ' ' << #b << '=' << (b) << '\n'; \
419#define check_wcond12a(a, sign, b, add, stream) \
421 stream << "WARNING:\n"; \
422 stream << '\n' << #a << #sign << #b << '\n'; \
423 stream << #a << '=' << (a) << ' ' << #b << '=' << (b) << '\n'; \
428#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream) \
429 if(a sign1_b1_sign0 a sign2_b2) { \
430 stream << "ERROR:\n"; \
431 stream << '\n' << #a << #sign1_b1_sign0 << #a << #sign2_b2 << '\n'; \
432 stream << #a << '=' << (a) << '\n'; \
435#define check_wcond21(a, sign1_b1_sign0, sign2_b2, stream) \
436 if(a sign1_b1_sign0 a sign2_b2) { \
437 stream << "WARNING:\n"; \
438 stream << '\n' << #a << #sign1_b1_sign0 << #a << #sign2_b2 << '\n'; \
439 stream << #a << '=' << (a) << '\n'; \
443#define check_econd23(a, sign1, b1, sign0, sign2, b2, stream) \
444 if(a sign1 b1 sign0 a sign2 b2) { \
445 stream << "ERROR:\n"; \
446 stream << '\n' << #a << #sign1 << #b1 << #sign0 << #a << #sign2 << #b2 \
448 stream << #a << '=' << (a) << ' ' << #b1 << '=' << (b1) << ' ' << #b2 \
449 << '=' << (b2) << '\n'; \
452#define check_wcond23(a, sign1, b1, sign0, sign2, b2, stream) \
453 if(a sign1 b1 sign0 a sign2 b2) { \
454 stream << "WARNING:\n"; \
455 stream << '\n' << #a << #sign1 << #b1 << #sign0 << #a << #sign2 << #b2 \
457 stream << #a << '=' << (a) << ' ' << #b1 << '=' << (b1) << ' ' << #b2 \
458 << '=' << (b2) << '\n'; \
462#define check_econd24(a1, sign1, b1, sign0, a2, sign2, b2, stream) \
463 if(a1 sign1 b1 sign0 a2 sign2 b2) { \
464 stream << "ERROR:\n"; \
465 stream << '\n' << #a1 << #sign1 << #b1 << #sign0 << #a2 << #sign2 << #b2 \
467 stream << #a1 << '=' << (a1) << ' ' << #b1 << '=' << (b1) << '\n'; \
468 stream << #a2 << '=' << (a2) << ' ' << #b2 << '=' << (b2) << '\n'; \
471#define check_wcond24(a1, sign1, b1, sign0, a2, sign2, b2, stream) \
472 if(a1 sign1 b1 sign0 a2 sign2 b2) { \
473 stream << "WARNING:\n"; \
474 stream << '\n' << #a1 << #sign1 << #b1 << #sign0 << #a2 << #sign2 << #b2 \
476 stream << #a1 << '=' << (a1) << ' ' << #b1 << '=' << (b1) << '\n'; \
477 stream << #a2 << '=' << (a2) << ' ' << #b2 << '=' << (b2) << '\n'; \
484#define check_econd(condition, add, stream)
485#define check_wcond(condition, add, stream)
487#define check_econd1(condition, a1, stream)
488#define check_wcond1(condition, a1, stream)
490#define check_econd2(condition, a1, a2, stream)
491#define check_wcond2(condition, a1, a2, stream)
493#define check_econd3(condition, a1, a2, a3, stream)
494#define check_wcond3(condition, a1, a2, a3, stream)
496#define check_econd4(condition, a1, a2, a3, a4, stream)
497#define check_wcond4(condition, a1, a2, a3, a4, stream)
499#define check_econd11(a, signb, stream)
500#define check_wcond11(a, signb, stream)
502#define check_econd12(a, sign, b, stream)
503#define check_wcond12(a, sign, b, stream)
505#define check_econd11a(a, signb, add, stream)
506#define check_wcond11a(a, signb, add, stream)
508#define check_econd12a(a, sign, b, add, stream)
509#define check_wcond12a(a, sign, b, add, stream)
512#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream)
513#define check_wcond21(a, sign1_b1_sign0, sign2_b2, stream)
516#define check_econd23(a, sign1, b1, sign0, sign2, b2, stream)
517#define check_wcond23(a, sign1, b1, sign0, sign2, b2, stream)
520#define check_econd24(a1, sign1, b1, sign0, a2, sign2, b2, stream)
521#define check_wcond24(a1, sign1, b1, sign0, a2, sign2, b2, stream)
536#define spexit(stream) \
539 stream << "File is " << __FILE__ << " , line number is " << __LINE__ \
541 spexit_action(stream); \
554#ifdef USE_BOOST_MULTITHREADING
564template <
class T>
class AbsList;
577 NameStack(
void) : qname(0), id(0), nmode(0) {
578 for (
int n = 0; n <
pqname; n++)
581 NameStack(
const NameStack& f) : qname(0), id(0), nmode(0) { *
this = f; }
583 NameStack& operator=(
const NameStack& f);
587 if (nmode == 1)
for (n = 0; n < qname; n++)
606#ifdef USE_BOOST_MULTITHREADING
609 NameStack* get_thread_stack(
void)
const;
610 NameStack* get_thread_stack_q(
long& nthread,
long& qthread)
const;
613 void remove_thread_stack(
void);
616#ifdef USE_BOOST_MULTITHREADING
646#ifdef USE_BOOST_MULTITHREADING
647 std::ostream& printname(std::ostream& file, NameStack* ns,
int n);
649 std::ostream& printname(std::ostream& file,
int n);
658 void printdel(std::ostream& file);
718 std::ostream&
hdr(std::ostream& file)
const {
719 file << name <<
": ";
723 std::ostream&
whdr(std::ostream& file)
const {
724 file << name <<
": WARNING:\n";
728 std::ostream&
ehdr(std::ostream& file)
const {
729 file << name <<
": ERROR:\n";
742 virtual void print(std::ostream& file);
743 virtual void finish(std::ostream& file);
748#include "wcpplib/util/FunNameStack.ic"
std::ostream & operator<<(std::ostream &file, const FunNameStack &f)
void spexit_action(std::ostream &file)
int s_throw_exception_in_spexit
FunNameStack_Assist(int fs_act=1, int fs_print=0)
wl_inline int put(const char *fname)
friend std::ostream & operator<<(std::ostream &file, const FunNameStack &f)
static FunNameStack & instance()
FunNameStack & operator=(const FunNameStack &f)
wl_inline void replace(const char *fname)
void set_parameters(int fs_act=1, int fs_print=0)
wl_inline void del(int nname)
wl_inline ~FunNameWatch()
std::ostream & ehdr(std::ostream &file) const
std::ostream & whdr(std::ostream &file) const
std::ostream & hdr(std::ostream &file) const
wl_inline FunNameWatch(const char *fname)
virtual void print(std::ostream &file)
GenError(const GenError &f)
virtual void finish(std::ostream &file)
GenError(const FunNameStack &f)