omgui::Signal Class Reference

#include <omgui/event.h>

List of all members.


Detailed Description

Represents a signalable event. Maintains a list of slots connected to the signal. The connected slots can be 'signaled' using operator(). The slots will be invoked in an undefined order.

Public Types

typedef Pointer< SlotBaseslot_type

Public Member Functions

Connection connect (const slot_type &slot)
void disconnect_all ()
bool operator() (const Event &)
 Signal ()
 ~Signal ()

Private Types

typedef std::queue
< Slots::iterator > 
DisconnectedSlots
typedef std::list< Pointer
< ConnectionImpl > > 
Slots

Private Member Functions

void disconnect (const Slots::iterator &it)

Private Attributes

DisconnectedSlots disconnected_slots
int signaling_
Slots slots

Friends

class ConnectionImpl

Member Typedef Documentation

typedef std::queue<Slots::iterator> omgui::Signal::DisconnectedSlots [private]

typedef std::list< Pointer<ConnectionImpl> > omgui::Signal::Slots [private]


Constructor & Destructor Documentation

omgui::Signal::Signal (  ) 

omgui::Signal::~Signal (  ) 

Disconnects all slots connected to the signal


Member Function Documentation

Connection omgui::Signal::connect ( const slot_type slot  ) 

Connects a slot to this signal. A Connection object is returned to manage the connection. It can be used to disconnect the slot.

void omgui::Signal::disconnect ( const Slots::iterator &  it  )  [private]

Used by ConnectionImpl to disconnect slots safely. If this signal is currently signaling its slots, the slot will be queued for removal but will not be signaled

void omgui::Signal::disconnect_all (  ) 

Disconnects all slots connected to this signal

bool omgui::Signal::operator() ( const Event event  ) 

Signals all of the connected slots.

Returns:
True if a slot processed the event


Friends And Related Function Documentation

friend class ConnectionImpl [friend]


Member Data Documentation


doxygen SourceForge.net Logo