libcwdversion 2.0.0
The C++ Debugging Support Library
Loading...
Searching...
No Matches
ContinuedChannel.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2000-2005, 2018, 2020, 2023, 2026 Carlo Wood
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
9
10#ifndef LIBCWD_CLASS_CONTINUED_CHANNEL_H
11#define LIBCWD_CLASS_CONTINUED_CHANNEL_H
12
13#include "control_flag.h"
14#include "libcwd/config.h"
15
16namespace libcwd {
17
18//===================================================================================================
19// class ContinuedChannel
20//
21// A debug channel with a special characteristic: It uses the same label and
22// flags as the previous Dout() call (no prefix is printed unless other
23// debug output interrupted the start, indicated with `continued_cf').
24//
25
26class ContinuedChannel
27{
28 private:
29 control_flag_t maskbit_;
30 // Written during initialization before this channel is made visible to other threads.
31 // The mask that contains the control bit.
32
33 public:
34 //-------------------------------------------------------------------------------------------------
35 // Constructor
36 //
37
38 // MT: All channel objects must be global so that `maskbit_' is zero
39 // at the start of the program and initialization occurs before other
40 // threads share the object.
41 explicit ContinuedChannel(control_flag_t maskbit);
42 // Construct a continued debug channel with extra control bit `cb'.
43
44 // MT: May only be called from the constructors of global objects (or single threaded functions).
45 void NS_initialize(control_flag_t maskbit);
46 // Force initialization in case the constructor of this global object
47 // wasn't called yet. Does nothing when the object was already initialized.
48
49 public:
50 control_flag_t get_maskbit() const;
51};
52
53} // namespace libcwd
54
55#endif // LIBCWD_CLASS_CONTINUED_CHANNEL_H
unsigned int control_flag_t
Definition control_flag.h:21
namespace for libcwd.