96template<
typename Tag_t,
typename... Args>
117 template<
typename Action_func>
127 static void execute(
const Args&... args);
155template<
typename Tag_t,
typename... Args>
156template<
typename Action_func>
159 auto& self = get_instance();
161 self.m_actions.emplace_back(std::move(action));
164template<
typename Tag_t,
typename... Args>
167 const auto& self = get_instance();
169 for (
const auto& action : self.m_actions)
175template<
typename Tag_t,
typename... Args>
A registry of callbacks (actions) sharing a common signature, intended for fan-out invocation across ...
static void register_action(Action_func &&action)
Registers a callback to be invoked by future execute() calls.
static void execute(const Args &... args)
Invokes every registered callback, in registration order, passing the given arguments to each.
std::vector< Function< void(Args...)> > m_actions
Registered callbacks, in registration order.
static Action_registry & get_instance()
Returns the singleton instance.
Mutex_non_recursive m_mutex
Protects m_actions.
Tag_t Tag
Alias for template parameter.
Flow module containing miscellaneous general-use facilities that don't fit into any other Flow module...
boost::unique_lock< Mutex > Lock_guard
Short-hand for advanced-capability RAII lock guard for any mutex, ensuring exclusive ownership of tha...
boost::mutex Mutex_non_recursive
Short-hand for non-reentrant, exclusive mutex. ("Reentrant" = one can lock an already-locked-in-that-...