10#ifndef LIBCWD_MACRO_FORALLDEBUGOBJECTS_H
11#define LIBCWD_MACRO_FORALLDEBUGOBJECTS_H
26#ifndef HIDE_FROM_DOXYGEN
31 using callback_type = void (*)(DebugObject&,
void*);
36 static DebugObjects
const& instance();
42 void add_if_missing(DebugObject* debug_object)
const;
49 template <
typename Func>
50 void for_each(Func&& func)
const
52 using func_type = std::remove_reference_t<Func>;
53 for_each_impl([](DebugObject& debugObject,
void* data) { (*
static_cast<func_type*
>(data))(debugObject); }, &func);
56 void for_each_impl(callback_type callback,
void* data)
const;
59static_assert(std::is_trivial_v<DebugObjects>,
"DebugObjects must be trivial to survive static destruction");
66#define LibcwdForAllDebugObjects(dc_namespace, ...) \
69 ::libcwd::_private_::DebugObjects::instance().for_each([&](::libcwd::DebugObject& debugObject) { \
70 using namespace ::libcwd; \
71 using namespace ::dc_namespace; \
The Debug Object class, this object represents one output device (ostream).
Definition DebugObject.h:110