Public Member Functions | Protected Types | Protected Attributes
Tonido::System::Dispatcher Class Reference

Base Message Dispatcher. More...

Inheritance diagram for Tonido::System::Dispatcher:
Tonido::System::DeferredDispatcher Tonido::System::MessageDispatcher

List of all members.

Public Member Functions

 Dispatcher (Defs::DispatcherID a_dispatcherID, const std::string &a_dispatcherName)
 Ctor.
virtual ~Dispatcher ()
 Dtor.
virtual void shutdownAll ()
 shutsdown and removes all handlers
virtual bool registerMessageHandler (Service *, MessageEventInfo::SharedPtr &pMEI)
 Register a service with the MessageDispatcher.
virtual bool unRegisterMessageHandler (Service *)
 UnRegister a service from the MessageDispatcher.
virtual void postUrgentMessage (Tonido::Data::Message::SharedPtr &message)
 Posts an Urgent message to the Dispatcher to be dispatched.
virtual void postMessage (Tonido::Data::Message::SharedPtr &message)
 Posts a message to the Dispatcher to be dispatched.
virtual void postMessage (Tonido::Data::Message a_message)
 Posts a message to the Dispatcher to be dispatched.
virtual void run ()
 run
Defs::DispatcherID dispatcherId () const
 Get the ID of this dispatcher.
std::string dispatcherName () const
 Gets the Dispatcher Name.

Protected Types

typedef BootHashMap
< std::string,
MessageEventInfo::SharedPtr > 
DispatchTable
typedef DispatchTable::iterator NonConstDispatchIter
typedef std::pair< std::string,
MessageEventInfo::SharedPtr > 
DispatchPair
typedef
DispatchTable::const_iterator 
DispatchIter

Protected Attributes

DispatchTable m_dispatchDirectory
 HashMap for Dispatching.
Poco::Thread m_workerThread
 Worker Thread.
volatile bool m_timeToDie
 Helper to kill the thread.
Poco::Event m_workerRunningEvent
Poco::NotificationQueue m_incomingQueue
Poco::FastMutex m_mutex
Poco::FastMutex m_destructMutex
StatsGroupm_pStatgroup
Defs::DispatcherID m_dispatcherID
std::string m_dispatcherName

Detailed Description

Base Message Dispatcher.

This is the base class for message dispatchers. Any dispatcher serivce would need to be derive from this class


Constructor & Destructor Documentation

Tonido::System::Dispatcher::Dispatcher ( Defs::DispatcherID  a_dispatcherID,
const std::string &  a_dispatcherName 
)

Ctor.

details if needed ...

Tonido::System::Dispatcher::~Dispatcher ( ) [virtual]

Dtor.

details if needed ...


Member Function Documentation

Defs::DispatcherID Tonido::System::Dispatcher::dispatcherId ( ) const

Get the ID of this dispatcher.

This allows services to tell which context they are being invoked from.

std::string Tonido::System::Dispatcher::dispatcherName ( ) const

Gets the Dispatcher Name.

Utility function that returns the name of the dispatcher

bool Tonido::System::Dispatcher::registerMessageHandler ( Service a_pService,
MessageEventInfo::SharedPtr &  pMEI 
) [virtual]

Register a service with the MessageDispatcher.

This is the function called by services to register themselves.

Reimplemented in Tonido::System::MessageDispatcher.

void Tonido::System::Dispatcher::run ( ) [virtual]

run

Internal function for thread running

void Tonido::System::Dispatcher::shutdownAll ( ) [virtual]

shutsdown and removes all handlers

shutsdown and unregisters all handlers

bool Tonido::System::Dispatcher::unRegisterMessageHandler ( Service a_pService) [virtual]

UnRegister a service from the MessageDispatcher.

same notes as registerServiceActive

Reimplemented in Tonido::System::MessageDispatcher.


Member Data Documentation

HashMap for Dispatching.

This hash map contains all the services and their associated message handlers


Generated on Wed Oct 12 2011 21:46:54. © CodeLathe LLC 2007-2011. All Rights Reserved.