template<typename... Args> asge::signals::Connection
This class represents a single Connection to a Signal.
#include <Signal.hpp>Every connection must have a unique identifier and a weak pointer to the connection map of the Signal class to which it is connected. Unique connection identifiers are generated incrementally when a new connection is created. The weak pointer to the Signal connection map is used to avoid dangling pointer and to ensure that operations are performed only if the object is still valid. For a single connection there are two ways of disconnecting it from the signal.
The first one is "manual disconnection", and involved calling the Connection::Disconnect method manually. The other one, relies on a so-called lifetime token which is a weak pointer to a generic object and it is used to automatic manage connection lifetime. That is, if the weak pointer becomes invalid the connection is automatically disconnected and so also destructuted.
Private Types
Friends
Private Attributes
Static Private Member Functions
Generate a monotonic increasing connection unique identifiers for connections handling.
Private Member Functions
Public Member Functions
Connection()void Disconnect()bool IsConnected() constReturns true if the current connection is still alive.
In this context a connection is alive if the identifier != 0, the weak pointer to the connection map is still valid and the lifetime token has not expired.
size_t GetConnectionId() const