Version: 8.3.0
YACS::ENGINE::SALOMEDispatcher Class Reference

#include <SALOMEDispatcher.hxx>

Inheritance diagram for YACS::ENGINE::SALOMEDispatcher:
Collaboration diagram for YACS::ENGINE::SALOMEDispatcher:

Public Member Functions

 SALOMEDispatcher ()
 
void dispatch (Node *object, const std::string &event)
 
void addObserver (YACS_ORB::Observer_ptr observer, int numid, std::string event)
 
virtual ~SALOMEDispatcher ()
 
- 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 ()
 

Static Public Member Functions

static void setSALOMEDispatcher ()
 
static SALOMEDispatchergetSALOMEDispatcher ()
 
- Static Public Member Functions inherited from YACS::ENGINE::Dispatcher
static DispatchergetDispatcher ()
 
static void setDispatcher (Dispatcher *dispatcher)
 

Static Protected Member Functions

static void * ThDisp (void *a)
 

Static Protected Attributes

static std::map< std::pair
< int, std::string >, std::set
< YACS_ORB::Observer_ptr > > 
_observers
 
static SALOMEDispatcher_disp = 0
 
static YACS::BASES::Semaphore _s1
 
static std::list< std::pair
< Node *, std::string > > 
_listOfEvents
 
- Static Protected Attributes inherited from YACS::ENGINE::Dispatcher
static Dispatcher_singleton = 0
 

Additional Inherited Members

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

Detailed Description

Definition at line 38 of file SALOMEDispatcher.hxx.

Constructor & Destructor Documentation

SALOMEDispatcher::SALOMEDispatcher ( )

Definition at line 35 of file SALOMEDispatcher.cxx.

36 {
37 }
SALOMEDispatcher::~SALOMEDispatcher ( )
virtual

Definition at line 39 of file SALOMEDispatcher.cxx.

40 {
41 }

Member Function Documentation

void SALOMEDispatcher::addObserver ( YACS_ORB::Observer_ptr  observer,
int  numid,
std::string  event 
)

Definition at line 73 of file SALOMEDispatcher.cxx.

76 {
77  _observers[std::pair<int,std::string>(numid,event)].insert(YACS_ORB::Observer::_duplicate(observer));
78 }
void SALOMEDispatcher::dispatch ( Node object,
const std::string &  event 
)
virtual

Reimplemented from YACS::ENGINE::Dispatcher.

Definition at line 55 of file SALOMEDispatcher.cxx.

References DEBTRACE, and YACS::ENGINE::Node::getNumId().

56 {
57  DEBTRACE("SALOMEDispatcher::dispatch " << event << " " << object->getNumId());
58  CORBA::Long numId = object->getNumId();
59  typedef set<YACS_ORB::Observer_ptr>::iterator jt;
60  std::pair<int,std::string> key(numId, event);
61  for(jt iter = _observers[key].begin(); iter!=_observers[key].end(); iter++)
62  {
63  if (! CORBA::is_nil(*iter))
64  {
65  DEBTRACE("numId, event " << numId << " " << event );
66  (*iter)->notifyObserver(numId, event.c_str());
67  }
68  else
69  DEBTRACE("************************** dispatch on a CORBA::nil *******************************");
70  }
71 }
SALOMEDispatcher * SALOMEDispatcher::getSALOMEDispatcher ( )
static

Definition at line 50 of file SALOMEDispatcher.cxx.

51 {
52  return _disp;
53 }
void SALOMEDispatcher::setSALOMEDispatcher ( )
static

Definition at line 43 of file SALOMEDispatcher.cxx.

References DEBTRACE, and YACS::ENGINE::Dispatcher::setDispatcher().

44 {
45  DEBTRACE("SALOMEDispatcher::setSALOMEDispatcher");
46  _disp=new SALOMEDispatcher();
48 }
static void* YACS::ENGINE::SALOMEDispatcher::ThDisp ( void *  a)
staticprotected

Member Data Documentation

SALOMEDispatcher * SALOMEDispatcher::_disp = 0
staticprotected

Definition at line 49 of file SALOMEDispatcher.hxx.

std::list< std::pair<Node*,std::string> > YACS::ENGINE::SALOMEDispatcher::_listOfEvents
staticprotected

Definition at line 52 of file SALOMEDispatcher.hxx.

map< pair< int, string >, set< YACS_ORB::Observer_ptr > > SALOMEDispatcher::_observers
staticprotected

Definition at line 48 of file SALOMEDispatcher.hxx.

YACS::BASES::Semaphore YACS::ENGINE::SALOMEDispatcher::_s1
staticprotected

Definition at line 51 of file SALOMEDispatcher.hxx.


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