Clio develop
The XRP Ledger API server.
|
Class to manage a map of key and its associative signal. More...
#include <TrackableSignalMap.hpp>
Public Member Functions | |
bool | connectTrackableSlot (ConnectionSharedPtr const &trackable, Key const &key, std::function< void(Args...)> slot) |
Connect a slot to the signal, the slot will be called when the signal is emitted and trackable is still alive. | |
bool | disconnect (ConnectionPtr trackablePtr, Key const &key) |
Disconnect a slot from the key's associative signal. | |
void | emit (Key const &key, Args const &... args) |
Emit the signal with the given key and arguments. | |
Class to manage a map of key and its associative signal.
Key | The type of the key. |
Session | The type of the object that will be tracked, when the object is destroyed, the connection will be removed lazily. |
Args | The types of the arguments that will be passed to the slot |
|
inline |
Connect a slot to the signal, the slot will be called when the signal is emitted and trackable is still alive.
trackable | Track this object's lifttime, if the object is destroyed, the connection will be removed lazily. When the slot is being called, the object is guaranteed to be alive. |
key | The key to the signal. |
slot | The slot connecting to the signal, the slot will be called when the assocaiative signal is emitted. |
|
inline |
Disconnect a slot from the key's associative signal.
trackablePtr | The pointer to the object that is being tracked. |
key | The key to the signal. |
|
inline |
Emit the signal with the given key and arguments.
key | The key to the signal. |
args | The arguments to be passed to the slot. |