![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtTemporaryAgentManager.h,v $ $Revision: 1.14 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #ifndef DtTemporaryEffectsManager_H_ 00014 #define DtTemporaryEffectsManager_H_ 00015 00016 #include <vrvCore/vrvCore.h> 00017 00018 #include <list> 00019 #include <boost/signals.hpp> 00020 00021 class DtVector; 00022 00023 namespace makVrv 00024 { 00025 00026 class DtAgent; 00027 class DtAgentManagerInterface; 00028 00035 class DT_DLL_VRVCORE DtTemporaryAgentManager 00036 { 00037 public: 00038 00040 DtTemporaryAgentManager(double currentTime); 00041 00043 virtual ~DtTemporaryAgentManager(); 00044 00051 virtual void takeAgent(DtAgent* agent, double lifeTime, 00052 double deleteDelay = 0.0); 00053 00055 void clearAll(); 00056 00058 virtual void tick(double currentTime); 00059 00061 boost::signal<void (DtAgent*)> signal_agentTimedOut; 00062 00063 protected: 00064 struct AgentParameters 00065 { 00066 DtAgent* agent; 00067 double timeToDelete; 00068 }; 00069 00070 typedef std::list<AgentParameters> AgentCollection; 00071 typedef AgentCollection::iterator iterator; 00072 typedef AgentCollection::const_iterator const_iterator; 00073 00074 inline iterator begin() { return myAgents.begin(); } 00075 inline const_iterator begin() const { return myAgents.begin(); } 00076 00077 inline iterator end() { return myAgents.end(); } 00078 inline const_iterator end() const { return myAgents.end(); } 00079 00080 AgentCollection myAgents; 00081 double myLastTime; 00082 }; 00083 } 00084 00085 #endif 00086