Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ObservableInterface Class Reference

#include <ObservableInterface.h>

Inheritance diagram for ObservableInterface::

Catcher ConnectionInterface LinkLayerInterface Node SslConnection TcpConnection List of all members.

Public Methods

virtual ~ObservableInterface ()
virtual void registerListener (ListenerInterface *)
 Use this if you want to register an object to listen for events. More...

virtual void removeListener (ListenerInterface *)
 Remove the listener from the Obserable object. More...

std::vector< ListenerInterface *> getListeners ()
 An accessor to the internal storage of this object. More...

virtual void fireEvent (int event)
virtual void fireEvent (int event, void *object)

Private Attributes

std::vector< ListenerInterface *> m_listeners
 a set of objects that are interested in receiving events. More...


Constructor & Destructor Documentation

virtual ObservableInterface::~ObservableInterface [inline, virtual]
 

Definition at line 9 of file ObservableInterface.h.


Member Function Documentation

void ObservableInterface::fireEvent int eventType,
void * object
[virtual]
 

Definition at line 48 of file ObservableInterface.cpp.

void ObservableInterface::fireEvent int eventType [virtual]
 

Definition at line 38 of file ObservableInterface.cpp.

Referenced by LinkLayerInterface::add(), Catcher::addNode(), TcpConnection::close(), SslConnection::close(), TcpConnection::connect(), SslConnection::connect(), and LinkLayerInterface::remove().

vector< ListenerInterface *> ObservableInterface::getListeners
 

An accessor to the internal storage of this object.

Use this only when absolutely necessary.

Definition at line 32 of file ObservableInterface.cpp.

void ObservableInterface::registerListener ListenerInterface * listener [virtual]
 

Use this if you want to register an object to listen for events.

Definition at line 11 of file ObservableInterface.cpp.

Referenced by ConnectionTableEntry::ConnectionTableEntry(), LinkLayerInterface::LinkLayerInterface(), NetworkLayer::NetworkLayer(), and VisualizerListener::setFrame().

void ObservableInterface::removeListener ListenerInterface * listener [virtual]
 

Remove the listener from the Obserable object.

If an object is listening, it should call this function before destroying itself, or whenever it doesnt need to be notified of events anymore.

Definition at line 21 of file ObservableInterface.cpp.


Member Data Documentation

std::vector<ListenerInterface*> ObservableInterface::m_listeners [private]
 

a set of objects that are interested in receiving events.

Definition at line 18 of file ObservableInterface.h.


The documentation for this class was generated from the following files:
Generated at Thu Jul 11 13:31:58 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001