1 // $Header$ 2 // 3 // Copyright (C) 2000 - 2004, by 4 // 5 // Carlo Wood, Run on IRC <carlo@alinoe.com> 6 // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt 7 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 8 // 9 // This file may be distributed under the terms of the Q Public License 10 // version 1.0 as appearing in the file LICENSE.QPL included in the 11 // packaging of this file. 12 // 13 14 /** \file class_continued_channel.h 15 * Do not include this header file directly, instead include \ref preparation_step2 "debug.h". 16 */ 17 18 #ifndef LIBCWD_CLASS_CONTINUED_CHANNEL_H 19 #define LIBCWD_CLASS_CONTINUED_CHANNEL_H 20 21 #ifndef LIBCWD_CONFIG_H 22 #include <libcwd/config.h> 23 #endif 24 #ifndef LIBCWD_CONTROL_FLAG_H 25 #include <libcwd/control_flag.h> 26 #endif 27 28 namespace libcwd { 29 30 //=================================================================================================== 31 // class continued_channel_ct 32 // 33 // A debug channel with a special characteristic: It uses the same label and 34 // flags as the previous Dout() call (no prefix is printed unless other 35 // debug output interrupted the start, indicated with `continued_cf'). 36 // 37 38 class continued_channel_ct { 39 private: 40 control_flag_t WNS_maskbit; 41 // The mask that contains the control bit. 42 43 public: 44 //------------------------------------------------------------------------------------------------- 45 // Constructor 46 // 47 48 // MT: All channel objects must be global so that `WNS_maskbit' is zero 49 // at the start of the program and initialization occurs before other 50 // threads share the object. 51 explicit continued_channel_ct(control_flag_t maskbit); 52 // Construct a continued debug channel with extra control bit `cb'. 53 54 // MT: May only be called from the constructors of global objects (or single threaded functions). 55 void NS_initialize(control_flag_t maskbit); 56 // Force initialization in case the constructor of this global object 57 // wasn't called yet. Does nothing when the object was already initialized. 58 59 public: 60 control_flag_t get_maskbit(void) const; 61 }; 62 63 } // namespace libcwd 64 65 #endif // LIBCWD_CLASS_CONTINUED_CHANNEL_H 66 67