10#ifndef LIBCWD_MACRO_FORALLDEBUGCHANNELS_H
11#define LIBCWD_MACRO_FORALLDEBUGCHANNELS_H
28#ifndef HIDE_FROM_DOXYGEN
33 using callback_type = void (*)(Channel&,
void*);
38 static DebugChannels
const& instance();
44 Channel* find(
char const* label)
const;
50 void initialize_channel(Channel& channel,
char const* label, LIBCWD_TSD_PARAM,
bool add_to_channel_list)
const;
56 void initialize_fatal_channel(FatalChannel& channel,
char const* label,
57 control_flag_t maskbit)
const;
63 template <
typename Func>
64 void for_each(Func&& func)
const
66 using func_type = std::remove_reference_t<Func>;
67 for_each_impl([](Channel& debugChannel,
void* data) { (*
static_cast<func_type*
>(data))(debugChannel); }, &func);
70 void for_each_impl(callback_type callback,
void* data)
const;
73static_assert(std::is_trivial_v<DebugChannels>,
"DebugChannels must be trivial to survive static destruction");
80#define LibcwdForAllDebugChannels(dc_namespace, ...) \
83 ::libcwd::_private_::DebugChannels::instance().for_each([&](::libcwd::Channel& debugChannel) { \
84 using namespace ::libcwd; \
85 using namespace ::dc_namespace; \
This object represents a debug channel, it has a fixed label. A debug channel can be viewed upon as a...
Definition Channel.h:74