libcwdversion 2.0.0
The C++ Debugging Support Library
Loading...
Searching...
No Matches
ChannelSet.inl.h
1// SPDX-FileCopyrightText: 2001-2004, 2018, 2020, 2026 Carlo Wood
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#ifndef LIBCWD_CLASS_CHANNEL_SET_INL
7#define LIBCWD_CLASS_CHANNEL_SET_INL
8
9#include "Channel.inl.h"
10#include "FatalChannel.inl.h"
11#include "Channel.h"
12#include "ChannelSet.h"
13#include "FatalChannel.h"
14#include "control_flag.h"
15
16namespace libcwd {
17
18inline ContinuedChannelSet& ContinuedChannelSet::operator|(control_flag_t cf)
19{
20 mask |= cf;
21 return *this;
22}
23
24inline ChannelSet& ChannelSet::operator|(control_flag_t cf)
25{
26 mask |= cf;
27 return *this;
28}
29
30inline ChannelSet& ChannelSet::operator|(Channel const& dc)
31{
32 if (!on)
33 {
34 label = dc.get_label();
35 on = dc.is_on();
36 }
37 return *this;
38}
39
40inline ChannelSet& ChannelSet::operator|(FatalChannel const& fdc)
41{
42 mask |= fdc.get_maskbit();
43 if (!on)
44 {
45 label = fdc.get_label();
46 on = true;
47 }
48 return *this;
49}
50
51} // namespace libcwd
52
53#endif // LIBCWD_CLASS_CHANNEL_SET_INL
char const * get_label() const
Pointer to the label of the debug channel.
Definition Channel.inl.h:44
bool is_on() const
Returns true if the channel is active.
Definition Channel.inl.h:35
This object represents a debug channel, it has a fixed label. A debug channel can be viewed upon as a...
Definition Channel.h:74
unsigned int control_flag_t
Definition control_flag.h:21
namespace for libcwd.