Salome HOME
merge from branch DEV tag mergeto_trunk_04apr08
[modules/yacs.git] / src / runtime / SALOMEDispatcher.hxx
1
2 #ifndef __SALOMEDISPATCHER_HXX__
3 #define __SALOMEDISPATCHER_HXX__
4
5 #include "Dispatcher.hxx"
6 #include "yacsgui.hh"
7 #include "Thread.hxx"
8 #include "Semaphore.hxx"
9
10 #include <string>
11 #include <list>
12 #include <map>
13 #include <set>
14
15 namespace YACS
16 {
17   namespace ENGINE
18   {
19     class SALOMEDispatcher: public Dispatcher
20     {
21     public:
22       SALOMEDispatcher();
23       void dispatch(Node* object, const std::string& event);
24       void addObserver(YACS_ORB::Observer_ptr observer,int numid, std::string event);
25       static void setSALOMEDispatcher();
26       static SALOMEDispatcher* getSALOMEDispatcher();
27       virtual ~SALOMEDispatcher();
28     protected:
29       static std::map< std::pair<int,std::string> , std::set<YACS_ORB::Observer_ptr> > _observers;
30       static SALOMEDispatcher* _disp;
31       static void *ThDisp( void *a);
32       static YACS::BASES::Semaphore _s1;
33       static std::list< std::pair<Node*,std::string> > _listOfEvents;
34     };
35
36
37   }
38 }
39
40 #endif