$darkmode
#include <trigger.hpp>
Public Member Functions | |
| void | set_executer (CallbackExecuter exe) |
| virtual void | emplace (TriggerPtr &&t, const Sync &s)=0 |
| virtual void | to_json (fable::Json &j) const =0 |
Protected Member Functions | |
| CallbackResult | execute (TriggerPtr &&t, const Sync &s) |
Friends | |
| void | to_json (fable::Json &j, const Callback &c) |
Callback provides the interface with which the global trigger manager, which maintains a list of all available event and action factories, can insert and execute triggers.
A Callback subtype is created for each event type, and is passed to the trigger manager when the event factory is registered. This allows the event owner, which knows exactly when it should trigger all events, to pass activated triggers to the event manager. This is done through the execute(TriggerPtr&&, const Sync&) method.
It is strongly recommended to use the DirectCallback template class instead of rolling your own Callback class. If you do roll your own, ensure that you do not execute triggers directly; rather use the provided CallbackExecuter.
|
pure virtual |
Place a trigger within the callback for storage.
Implemented in cloe::AliasCallback, cloe::DirectCallback< E, Ctx >, engine::events::TimeCallback, and engine::events::NextCallback.
|
protected |
Execute a trigger in the given sync context by passing it to the executer.
|
inline |
Set the trigger executer function.
|
pure virtual |
Return JSON representation of all contained triggers.
Implemented in cloe::DirectCallback< E, Ctx >, and cloe::AliasCallback.