00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef LIBCWD_STRUCT_DEBUG_TSD_H
00015 #define LIBCWD_STRUCT_DEBUG_TSD_H
00016
00017 #ifndef LIBCWD_CONFIG_H
00018 #include <libcwd/config.h>
00019 #endif
00020 #ifndef LIBCWD_CLASS_CHANNEL_SET_H
00021 #include <libcwd/class_channel_set.h>
00022 #endif
00023 #ifndef LIBCWD_PRIVATE_DEBUG_STACK_H
00024 #include <libcwd/private_debug_stack.h>
00025 #endif
00026 #ifndef LIBCWD_CLASS_DEBUG_STRING_H
00027 #include <libcwd/class_debug_string.h>
00028 #endif
00029 #ifndef LIBCWD_PRIVATE_STRUCT_TSD_H
00030 #include <libcwd/private_struct_TSD.h>
00031 #endif
00032 #ifndef LIBCW_IOSFWD
00033 #define LIBCW_IOSFWD
00034 #include <iosfwd>
00035 #endif
00036
00037 namespace libcwd {
00038
00039 #if CWDEBUG_LOCATION
00040 namespace cwbfd {
00041 bool ST_init(LIBCWD_TSD_PARAM);
00042 }
00043 #endif
00044
00045 class debug_ct;
00046 class channel_ct;
00047 class fatal_channel_ct;
00048 class laf_ct;
00049
00050
00051
00052
00053
00054
00055
00056 struct debug_tsd_st {
00057 friend class debug_ct;
00058
00059 #if !LIBCWD_THREAD_SAFE
00060 int _off;
00061
00062 #endif
00063
00064 bool tsd_initialized;
00065
00066
00067 #if CWDEBUG_DEBUGOUTPUT
00068
00069
00070 bool first_time;
00071 #endif
00072
00073 laf_ct* current;
00074
00075
00076 std::ostream* current_bufferstream;
00077
00078
00079
00080 _private_::debug_stack_tst<laf_ct*> laf_stack;
00081
00082
00083 bool start_expected;
00084
00085
00086 bool unfinished_expected;
00087
00088
00089 int off_count;
00090
00091
00092 _private_::debug_stack_tst<int> continued_stack;
00093
00094
00095 debug_string_ct margin;
00096
00097
00098 debug_string_ct marker;
00099
00100
00101 debug_string_stack_element_ct* M_margin_stack;
00102
00103
00104 debug_string_stack_element_ct* M_marker_stack;
00105
00106
00107 unsigned short indent;
00108
00109
00110
00111
00112 void start(debug_ct& debug_object, channel_set_data_st& channel_set LIBCWD_COMMA_TSD_PARAM);
00113 void finish(debug_ct& debug_object, channel_set_data_st& LIBCWD_COMMA_TSD_PARAM);
00114 void fatal_finish(debug_ct& debug_object, channel_set_data_st& channel_set LIBCWD_COMMA_TSD_PARAM) __attribute__ ((__noreturn__));
00115
00116
00117 void init(void);
00118 #if LIBCWD_THREAD_SAFE
00119
00120
00121
00122
00123
00124 debug_tsd_st(void) : tsd_initialized(false), current_bufferstream(NULL) { }
00125 #endif
00126 ~debug_tsd_st();
00127 };
00128
00129 }
00130
00131 #endif // LIBCWD_STRUCT_DEBUG_TSD_H
00132