Version: 8.3.0
MyDispatcher Class Reference
Inheritance diagram for MyDispatcher:
Collaboration diagram for MyDispatcher:

Public Member Functions

void dispatch (YACS::ENGINE::Node *object, const std::string &event)
 
void addObserver (YACS_ORB::Observer_ptr observer, int numid, const std::string &event)
 
- Public Member Functions inherited from YACS::ENGINE::Dispatcher
virtual void dispatch2 (Node *object, const std::string &event, void *something)
 
virtual void addObserver (Observer *observer, Node *object, const std::string &event)
 
virtual void removeObserver (Observer *observer, Node *object, const std::string &event)
 
virtual void printObservers ()
 
virtual ~Dispatcher ()
 

Protected Attributes

std::map< std::pair< int,
std::string >, std::set
< YACS_ORB::Observer_ptr > > 
_observers
 
- Protected Attributes inherited from YACS::ENGINE::Dispatcher
std::map< std::pair< Node
*, std::string >, std::set
< Observer * > > 
_observers
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::Dispatcher
static DispatchergetDispatcher ()
 
static void setDispatcher (Dispatcher *dispatcher)
 
- Static Protected Attributes inherited from YACS::ENGINE::Dispatcher
static Dispatcher_singleton = 0
 

Detailed Description

Definition at line 42 of file yacsSrv.cxx.

Member Function Documentation

void MyDispatcher::addObserver ( YACS_ORB::Observer_ptr  observer,
int  numid,
const std::string &  event 
)
inline

Definition at line 56 of file yacsSrv.cxx.

57  {
58  _observers[std::pair<int,std::string>(numid,event)].insert(YACS_ORB::Observer::_duplicate(observer));
59  // printObservers();
60  }
void MyDispatcher::dispatch ( YACS::ENGINE::Node object,
const std::string &  event 
)
inlinevirtual

Reimplemented from YACS::ENGINE::Dispatcher.

Definition at line 45 of file yacsSrv.cxx.

References YACS::ENGINE::Node::getNumId().

46  {
47  std::cerr << "dispatch " << object->getNumId() << std::endl;
48  typedef std::set<YACS_ORB::Observer_ptr>::iterator jt;
49  std::pair<int,std::string> key(object->getNumId(),event);
50  for(jt iter=_observers[key].begin();iter!=_observers[key].end();iter++)
51  {
52  (*iter)->notifyObserver((CORBA::Long)object->getNumId(),event.c_str());
53  }
54  }

Member Data Documentation

std::map< std::pair<int,std::string> , std::set<YACS_ORB::Observer_ptr> > MyDispatcher::_observers
protected

Definition at line 62 of file yacsSrv.cxx.


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