21 #include <type_traits>
62 template <
typename IDType,
typename CallbackType,
typename ContextType>
64 static_assert(std::is_integral_v<IDType>,
"IDType must be and integral type");
66 std::is_invocable_v<CallbackType, const ContextType&>,
67 "CallbackType must be callable with \'const ContextType&\' as the argument");
86 void notify(
const ContextType& context) {
89 callback_pair.second(context);
98 deferred_unregister_ids_.clear();
std::map< IDType, CallbackType > callbacks_
void notify(const ContextType &context)
std::vector< IDType > deferred_unregister_ids_
void unregisterCallback(IDType id)
IDType registerCallback(CallbackType callback)