ActiveObjectManagerAce.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __ACTIVEOBJECT_ACTIVEOBJECTMANAGERACE_H
00032 #define __ACTIVEOBJECT_ACTIVEOBJECTMANAGERACE_H
00033
00034 #include <ActiveObjectManager.hpp>
00035
00036 #include <ace/Mutex.h>
00037 #include <ace/Semaphore.h>
00038
00039 namespace mermaid
00040 {
00041 namespace support
00042 {
00043 namespace activeobject
00044 {
00045
00046
00047
00048
00049
00050
00051 class ActiveObjectManagerAce : public ActiveObjectManager
00052 {
00053 public:
00054
00055 virtual ~ActiveObjectManagerAce();
00056
00057
00058
00059
00060
00061
00062
00063
00064 static shared_ptr<ActiveObjectManagerAce> getInstance();
00065
00066 virtual shared_ptr<ActiveObject> createActiveObject();
00067
00068 virtual void addActiveObject (shared_ptr<ActiveObject> ao);
00069
00070 virtual void notifyActiveObjectStateChange (ActiveObject * ao, ActiveObjectState previousState);
00071
00072 void waitForActiveObjectsToStop();
00073
00074 virtual void stopAllActiveObjects();
00075
00076 private:
00077
00078 ActiveObjectManagerAce();
00079
00080 static shared_ptr<ActiveObjectManagerAce> instance_;
00081
00082 virtual vector<shared_ptr<ActiveObject> > getActiveObjectVector();
00083
00084 virtual set<shared_ptr<ActiveObject> > getActiveObjectStateSet (ActiveObjectState s);
00085
00086 ACE_Mutex internalDataMutex_;
00087
00088 shared_ptr<ACE_Semaphore> waitForTerminateSemaphore_;
00089
00090
00091 };
00092
00093 }
00094 }
00095 }
00096
00097 #endif // __ACTIVEOBJECT_ACTIVEOBJECTMANAGERACE_H