cxxtools::Signal< const cxxtools::Event & > Class Template Reference

#include <cxxtools/signal.h>

Inheritance diagram for cxxtools::Signal< const cxxtools::Event & >:
cxxtools::Connectable

Classes

class  EventRoute
class  IEventRoute
struct  Sentry

Public Member Functions

 Signal ()
 ~Signal ()
void send (const cxxtools::Event &ev) const
template<typename R >
Connection connect (const BasicSlot< R, const cxxtools::Event & > &slot)
template<typename R >
void disconnect (const BasicSlot< R, const cxxtools::Event & > &slot)
template<typename EventT >
void subscribe (const BasicSlot< void, const EventT & > &slot)
template<typename EventT >
void unsubscribe (const BasicSlot< void, const EventT & > &slot)
virtual void onConnectionOpen (const Connection &c)
 Registers a Connection with the Connectable.
virtual void onConnectionClose (const Connection &c)
 Unregisters a Connection from the Connectable.
- Public Member Functions inherited from cxxtools::Connectable
 Connectable ()
 Default constructor.
virtual ~Connectable ()
 Closes all connections.
size_t connectionCount () const

Protected Member Functions

void addRoute (const std::type_info *ti, IEventRoute *route)
void removeRoute (const Slot &slot)
void removeRoute (const std::type_info *ti, const Slot &slot)
- Protected Member Functions inherited from cxxtools::Connectable
 Connectable (const Connectable &)
 Copy constructor.
Connectableoperator= (const Connectable &)
 Assignment operator.
const std::list< Connection > & connections () const
 Returns a list of all current connections.
std::list< Connection > & connections ()
 Returns a list of all current connections.
void clear ()

Additional Inherited Members

- Protected Attributes inherited from cxxtools::Connectable
std::list< Connection_connections
 A list of all current connections.

Constructor & Destructor Documentation

cxxtools::Signal< const cxxtools::Event & >::Signal ( )
cxxtools::Signal< const cxxtools::Event & >::~Signal ( )

Member Function Documentation

void cxxtools::Signal< const cxxtools::Event & >::addRoute ( const std::type_info *  ti,
IEventRoute *  route 
)
protected
template<typename R >
Connection cxxtools::Signal< const cxxtools::Event & >::connect ( const BasicSlot< R, const cxxtools::Event & > &  slot)
inline
template<typename R >
void cxxtools::Signal< const cxxtools::Event & >::disconnect ( const BasicSlot< R, const cxxtools::Event & > &  slot)
inline
virtual void cxxtools::Signal< const cxxtools::Event & >::onConnectionClose ( const Connection c)
virtual

Unregisters a Connection from the Connectable.

This function is called when a new Connection involving this object is closed. The default implementation removes the connection from its list of connections.

Parameters
cConnection being opened

Reimplemented from cxxtools::Connectable.

virtual void cxxtools::Signal< const cxxtools::Event & >::onConnectionOpen ( const Connection c)
virtual

Registers a Connection with the Connectable.

This function is called when a new Connection involving this object is opened. The default implementation adds the connection to a list, so the destructor can close it.

Parameters
cConnection being opened
Returns
True if the Connection was accepted

Reimplemented from cxxtools::Connectable.

void cxxtools::Signal< const cxxtools::Event & >::removeRoute ( const Slot slot)
protected
void cxxtools::Signal< const cxxtools::Event & >::removeRoute ( const std::type_info *  ti,
const Slot slot 
)
protected
void cxxtools::Signal< const cxxtools::Event & >::send ( const cxxtools::Event ev) const
template<typename EventT >
void cxxtools::Signal< const cxxtools::Event & >::subscribe ( const BasicSlot< void, const EventT & > &  slot)
inline
template<typename EventT >
void cxxtools::Signal< const cxxtools::Event & >::unsubscribe ( const BasicSlot< void, const EventT & > &  slot)
inline

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