![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2006 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: globalPlanMgr.h,v $ $Revision: 1.6 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00013 00014 #ifndef globalPlanMgr_h 00015 #define globalPlanMgr_h 00016 00017 #include "vrfplanmgr/vrfplanmgrDefines.h" 00018 #include <map> 00019 #include <vlutil/vlString.h> 00020 00021 class DtPlan; 00022 class DtString; 00023 class DtSimManager; 00024 class DtSimMessage; 00025 class DtList; 00026 class DtGlobalPlanExecutor; 00027 class DtSimTickArguments; 00028 00032 class DT_DLL_vrfplanmgr DtGlobalPlanManager 00033 { 00034 public: 00036 DtGlobalPlanManager(DtSimManager* simManager); 00037 00039 virtual ~DtGlobalPlanManager(); 00040 00041 virtual bool init(); 00042 00043 virtual void tick(); 00044 00045 static void tickCallback(void* args); 00046 00049 00050 virtual void enableExecutionState(); 00051 virtual void disableExecutionState(); 00053 00055 virtual void clearPlans(); 00056 00058 virtual void writePlanFile(const DtString& filename) const; 00059 00062 virtual bool readPlanFile(const DtString& filename); 00063 00064 protected: 00066 virtual void registerInterfaceMessageCallbacks(); 00067 00069 static void requestPlanListCallback(DtSimMessage* msg, void* usr); 00070 00072 virtual void sendPlanList(); 00073 00075 static void requestPlanCallback(DtSimMessage* msg, void* usr); 00080 virtual void processRequestPlan(DtSimMessage* msg); 00081 00083 static void setPlanCallback(DtSimMessage* msg, void* usr); 00087 virtual void processSetPlan(DtSimMessage* msg); 00088 00093 virtual void setPlan(const DtString& name, const DtList& statementList); 00094 00098 virtual void appendToPlan(const DtString& name, const DtList& statementList); 00099 00101 static void deletePlanCallback(DtSimMessage* msg, void* usr); 00102 00105 virtual void processDeletePlan(DtSimMessage* msg); 00106 00109 virtual DtPlan* makePlan(const DtString& name) const; 00110 00112 virtual DtGlobalPlanExecutor* createPlanExecutor(); 00113 00115 static void currentStatementChangedCallback( 00116 const DtPlan& plan, void* usrData); 00117 00120 virtual void processCurrentStatementChanged(const DtPlan& plan); 00121 00124 void deletePlans(); 00125 00126 private: 00128 DtGlobalPlanManager(); 00130 DtGlobalPlanManager(const DtGlobalPlanManager& orig); 00132 DtGlobalPlanManager& operator=(const DtGlobalPlanManager& orig); 00133 00134 protected: 00135 00136 DtSimManager* mySimManager; 00137 typedef std::map<DtString, DtPlan*> DtPlanMap; 00138 DtPlanMap myPlanMap; 00139 bool myExecutionState; 00140 DtGlobalPlanExecutor* myPlanExecutor; 00141 }; 00142 00143 #endif