|
VoltMod
C++23 framework for CS2 server plugins
|
#include <CallbackRegistry.hpp>
Public Member Functions | |
| uint64_t | Add (T item) |
| Subscription | AddOwned (T item) |
| bool | Remove (uint64_t id) |
| void | Clear () |
| bool | Empty () const |
| size_t | Size () const |
| T * | Find (uint64_t id) |
| void | DispatchIf (std::predicate< const T & > auto &&pred, std::invocable< T & > auto &&fn) |
| void | Dispatch (std::invocable< T & > auto &&fn) |
Definition at line 23 of file CallbackRegistry.hpp.
Store item and return its handle.
Definition at line 27 of file CallbackRegistry.hpp.
References VoltMod::ReadFile().
Referenced by VoltMod::CallbackRegistry< T >::AddOwned(), and VoltMod::Event< Args >::operator+=().
|
inline |
Add, returning a Subscription that removes the item when dropped.
Definition at line 36 of file CallbackRegistry.hpp.
References VoltMod::CallbackRegistry< T >::Add(), VoltMod::ReadFile(), and VoltMod::CallbackRegistry< T >::Remove().
|
inline |
Definition at line 64 of file CallbackRegistry.hpp.
References VoltMod::ReadFile().
|
inline |
DispatchIf over every stored item.
Definition at line 112 of file CallbackRegistry.hpp.
References VoltMod::CallbackRegistry< T >::DispatchIf(), VoltMod::ReadFile(), and VoltMod::T.
Referenced by VoltMod::Event< Args >::Raise().
|
inline |
Invoke fn on every item pred accepts. A callback may add or remove items, its own included, or dispatch again; items it adds first run on the next dispatch.
Definition at line 91 of file CallbackRegistry.hpp.
References VoltMod::ReadFile().
Referenced by VoltMod::CallbackRegistry< T >::Dispatch(), and VoltMod::Scheduler::OnGameFrame().
|
inline |
Definition at line 78 of file CallbackRegistry.hpp.
Referenced by VoltMod::Event< Args >::Empty(), and VoltMod::Event< Args >::operator+=().
Null once removed.
Definition at line 83 of file CallbackRegistry.hpp.
References VoltMod::ReadFile().
Referenced by VoltMod::Scheduler::OnGameFrame().
Whether id was stored; an unknown id is ignored.
Definition at line 43 of file CallbackRegistry.hpp.
References VoltMod::ReadFile().
Referenced by VoltMod::CallbackRegistry< T >::AddOwned(), VoltMod::Scheduler::OnGameFrame(), and VoltMod::Event< Args >::operator+=().
|
inline |
Definition at line 80 of file CallbackRegistry.hpp.
Referenced by VoltMod::Event< Args >::Count().