Nebula
Loading...
Searching...
No Matches
Messaging::DelegateTable Class Reference

#include <delegatetable.h>

Detailed Description

Associates message ids with handler delegates.

One message id may be associated with any number of handler functions. The order of handler functions for one message id will be preserved.

Public Member Functions

template<class CLASS , void(CLASS::*)(const Ptr< Message > &) METHOD>
void Bind (const Id &msgId, CLASS *obj)
 bind a message id to a method call
 
bool Invoke (const Ptr< Message > &msg)
 invoke delegates bound to msg, returns false if no delegates bound to msg id
 

Private Member Functions

void AddDelegate (const Id &msgId, const Util::Delegate< void(const Ptr< Message > &)> &del)
 add a delegate
 

Private Attributes

Util::Array< Util::Array< Util::Delegate< void(const Ptr< Message > &)> > delegateArray )
 
Util::Dictionary< const Id *, IndexTidIndexMap
 

Member Function Documentation

◆ AddDelegate()

void Messaging::DelegateTable::AddDelegate ( const Id & msgId,
const Util::Delegate< void(const Ptr< Message > &)> & del )
private

add a delegate

◆ Bind()

template<class CLASS , void(CLASS::*)(const Ptr< Message > &) METHOD>
void Messaging::DelegateTable::Bind ( const Id & msgId,
CLASS * obj )

bind a message id to a method call

◆ Invoke()

bool Messaging::DelegateTable::Invoke ( const Ptr< Message > & msg)

invoke delegates bound to msg, returns false if no delegates bound to msg id

Member Data Documentation

◆ delegateArray

Util::Array<Util::Array<Util::Delegate<void(const Ptr<Message>&)> > Messaging::DelegateTable::delegateArray)
private

◆ idIndexMap

Util::Dictionary<const Id*, IndexT> Messaging::DelegateTable::idIndexMap
private

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