openikev2::EventBus Class Reference

This class represents a Event Bus. More...

#include <eventbus.h>

List of all members.

Public Member Functions

void registerBusObserver (BusObserver &observer, BusEvent::EVENT_TYPE event_type)
 Register a BusObserver in the EventBus.
void removeBusObserver (BusObserver &observer)
 Removes an observer from the observers lists.
void sendBusEvent (auto_ptr< BusEvent > event)
 Sends a new Event in the EventBus.

Static Public Member Functions

static EventBusgetInstance ()
 Gets the unique EventBus instance.

Protected Member Functions

 EventBus ()
 Creates a new EventBus.

Protected Attributes

map< BusEvent::EVENT_TYPE,
BusObserverVector > 
event_observers
 Registered observers collection by Event type.
auto_ptr< Mutexmap_mutex
 Mutex to protect observers collection.

Static Protected Attributes

static EventBusinstance
 Unique EventBus instance.


Detailed Description

This class represents a Event Bus.

It follows the Singleton design pattern.

Author:
Alejandro Perez Mendez, Pedro J. Fernandez Ruiz <alejandro_perez@dif.um.es, pedroj.fernandez@dif.um.es>


Member Function Documentation

EventBus & openikev2::EventBus::getInstance (  )  [static]

Gets the unique EventBus instance.

If the instance doesn't exist, this method creates one and returns it.

Returns:
The unique EventBus instance.

void openikev2::EventBus::registerBusObserver ( BusObserver observer,
BusEvent::EVENT_TYPE  event_type 
)

Register a BusObserver in the EventBus.

Parameters:
observer BusObserver to be registered
event_type Type of the events observer wants to receive

void openikev2::EventBus::removeBusObserver ( BusObserver observer  ) 

Removes an observer from the observers lists.

Note that object will not be deleted.

Parameters:
observer Observer to be removed

void openikev2::EventBus::sendBusEvent ( auto_ptr< BusEvent event  ) 

Sends a new Event in the EventBus.

All the registered observers will be notified.

Parameters:
event Notified Event


Generated on Fri Jul 27 11:04:50 2007 for libopenikev2 by  doxygen 1.5.1