Bromeon
Public Member Functions
thor::Connection Class Reference

Class that manages the connection between an event and a listener. More...

List of all members.

Public Member Functions

 Connection ()
 Default constructor: Creates an instance which is initially invalid.
bool IsConnected () const
 Checks whether the instance currently references a listener.
void Invalidate ()
 Invalidates this instance.
void Disconnect ()
 Disconnects the referenced listener from its triggering event.

Detailed Description

Class that manages the connection between an event and a listener.

You need a connection, if you want to remove listeners bound to events. The class Connection uses shared-ownership semantics, that means copying its instances results in multiple references to the same listener. It automatically invalidates when the referenced listener is disconnected from the event system.


Constructor & Destructor Documentation

Default constructor: Creates an instance which is initially invalid.

Assign another object to make this instance a valid Connection.


Member Function Documentation

Disconnects the referenced listener from its triggering event.

This action invalidates this and all other Connections to the referenced listener. If no connection exists at the moment, this function has no effect.

Invalidates this instance.

This does not affect the referenced listener (if any) nor other Connection instances. Invalidating an already invalid instance has no effects.
After the invalidation, you can reuse this instance by assigning another one. But normally, it pays out to have as few invalid connections as possible, as this saves you from case differentiations.

Checks whether the instance currently references a listener.

Returns:
true if this instance is currently connected.

The documentation for this class was generated from the following file: