Main Page   Reference Manual   Namespace List   Compound List   Namespace Members   Compound Members   File Members  

class_continued_channel.h
Go to the documentation of this file.
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 
18 #ifndef LIBCWD_CLASS_CONTINUED_CHANNEL_H
19 #define LIBCWD_CLASS_CONTINUED_CHANNEL_H
20 
21 #ifndef LIBCWD_CONFIG_H
22 #include "config.h"
23 #endif
24 #ifndef LIBCWD_CONTROL_FLAG_H
25 #include "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() const;
61 };
62 
63 } // namespace libcwd
64 
65 #endif // LIBCWD_CLASS_CONTINUED_CHANNEL_H
66 
unsigned int control_flag_t
Definition: control_flag.h:31
namespace for libcwd.
Definition: debug.cc:87
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.