libcwd: The C++ Debugging Support Library - Reference Manual
Author: Carlo Wood
Description: C++ debugging support library with ostream debug output
Keywords: libcwd, debug output, debug facility, debug channel, object orientation, OO, C++, nested debug output, ostream, memory allocation, debugging, source file and line number

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

# libcwd/class_continued_channel.h

Go to the documentation of this file.

    00001 // $Header$
    00002 //
    00003 // Copyright (C) 2000 - 2004, by
    00004 //
    00005 // Carlo Wood, Run on IRC <carlo@alinoe.com>
    00006 // RSA-1024 0x624ACAD5 1997-01-26                    Sign & Encrypt
    00007 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6  F6 F6 55 DD 1C DC FF 61
    00008 //
    00009 // This file may be distributed under the terms of the Q Public License
    00010 // version 1.0 as appearing in the file LICENSE.QPL included in the
    00011 // packaging of this file.
    00012 //
    00013
    00018 #ifndef LIBCWD_CLASS_CONTINUED_CHANNEL_H
    00019 #define LIBCWD_CLASS_CONTINUED_CHANNEL_H
    00020
    00021 #ifndef LIBCWD_CONFIG_H
    00022 #include <libcwd/config.h>
    00023 #endif
    00024 #ifndef LIBCWD_CONTROL_FLAG_H
    00025 #include <libcwd/control_flag.h>
    00026 #endif
    00027
    00028 namespace libcwd {
    00029
    00030 //===================================================================================================
    00031 // class continued_channel_ct
    00032 //
    00033 // A debug channel with a special characteristic: It uses the same label and
    00034 // flags as the previous Dout() call (no prefix is printed unless other
    00035 // debug output interrupted the start, indicated with `continued_cf').
    00036 //
    00037
    00038 class continued_channel_ct {
    00039 private:
    00040   control_flag_t WNS_maskbit;
    00041     // The mask that contains the control bit.
    00042
    00043 public:
    00044   //-------------------------------------------------------------------------------------------------
    00045   // Constructor
    00046   //
    00047
    00048   // MT: All channel objects must be global so that `WNS_maskbit' is zero
    00049   //     at the start of the program and initialization occurs before other
    00050   //     threads share the object.
    00051   explicit continued_channel_ct(control_flag_t maskbit);
    00052     // Construct a continued debug channel with extra control bit `cb'.
    00053
    00054   // MT: May only be called from the constructors of global objects (or single threaded functions).
    00055   void NS_initialize(control_flag_t maskbit);
    00056     // Force initialization in case the constructor of this global object
    00057     // wasn't called yet.  Does nothing when the object was already initialized.
    00058
    00059 public:
    00060   control_flag_t get_maskbit(void) const;
    00061 };
    00062
    00063 } // namespace libcwd
    00064
    00065 #endif // LIBCWD_CLASS_CONTINUED_CHANNEL_H
    00066