19 template <
typename... InputsT>
25 void Call(InputsT... args)
const {
26 auto list =
_list.Load();
27 for (
auto &item : *list) {
28 item.callback(args...);
35 _list.Push(
Item{id, std::move(callback)});
40 _list.DeleteByValue(
id);
54 return lhs.
id == rhs.
id;
#define DEBUG_ASSERT(predicate)
Inherit (privately) to suppress copy/move construction and assignment.
Holds an atomic pointer to a list.
void Call(InputsT... args) const
size_t Push(CallbackType &&callback)
std::atomic_size_t _counter
std::function< void(InputsT...)> CallbackType
This file contains definitions of common data structures used in traffic manager.
friend bool operator==(size_t lhs, const Item &rhs)
friend bool operator==(const Item &lhs, size_t rhs)
friend bool operator==(const Item &lhs, const Item &rhs)