ActiveObjectManager.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 #ifndef __ACTIVEOBJECT_ACTIVEOBJECTMANAGER_H
00031 #define __ACTIVEOBJECT_ACTIVEOBJECTMANAGER_H
00032
00033 #include "ActiveObjectState.hpp"
00034
00035 #include <map>
00036 #include <set>
00037 #include <vector>
00038 #include <boost/shared_ptr.hpp>
00039
00040 namespace mermaid
00041 {
00042 namespace support
00043 {
00044 namespace activeobject
00045 {
00046 using std::map;
00047 using std::set;
00048 using std::vector;
00049 using boost::shared_ptr;
00050
00051 class ActiveObject;
00052
00053
00054
00055
00056
00057
00058 class ActiveObjectManager
00059 {
00060 friend class ActiveObject;
00061
00062
00063 public:
00064 virtual shared_ptr<ActiveObject> createActiveObject() = 0;
00065
00066 virtual ~ActiveObjectManager();
00067
00068 int getNumberOfActiveObjects();
00069
00070 virtual void stopAllActiveObjects() = 0;
00071
00072
00073 protected:
00074
00075
00076
00077
00078 ActiveObjectManager();
00079
00080
00081 virtual void addActiveObject (shared_ptr<ActiveObject> ao);
00082
00083 virtual void notifyActiveObjectStateChange (ActiveObject * ao, ActiveObjectState previousState);
00084
00085 virtual vector<shared_ptr<ActiveObject> > getActiveObjectVector();
00086
00087 virtual set<shared_ptr<ActiveObject> > getActiveObjectStateSet (ActiveObjectState s);
00088
00089
00090 private:
00091 vector<shared_ptr<ActiveObject> > aoVector_;
00092 map<ActiveObject*, shared_ptr<ActiveObject> > smartPointerMap;
00093
00094 map<ActiveObjectState, set<shared_ptr<ActiveObject> > > stateMap;
00095 };
00096 }
00097 }
00098 }
00099
00100 #include <ActiveObject.hpp>
00101
00102 #endif // __ACTIVEOBJECT_ACTIVEOBJECTMANAGER_H