VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
globalPlanManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 #include <map>
15 #include <vector>
16 #include <vlutil/vlString.h>
17 #include <vrfutil/rwUUID.h>
18 #include <tbb/recursive_mutex.h>
19 
20 #include <boost/unordered_map.hpp>
21 #include <boost/signals2.hpp>
22 
23 class DtLocalObject;
24 class DtSimObject;
25 class DtPlan;
26 class DtSimStatement;
27 class DtIfPlan;
28 class DtString;
31 class DtSimMessage;
32 class DtlInputStream;
33 
46 {
47 public:
48  typedef boost::unordered_map<DtUUID, DtLocalObject*> GlobalPlans;
49 
50 public:
53 
55  virtual ~DtGlobalPlanManager();
56 
57  virtual bool init();
58 
61  virtual bool readPlanFile(const DtString& filename);
62  virtual bool readPlanFileFromZipFile(const DtFilename& scenarioZipFile, const DtString& filename);
63 
65  const GlobalPlans& globalPlans() const { return myGlobalPlans; };
66 
68  virtual void sendPlanList();
69 
70  virtual void completeInitialization();
71 
73  virtual void addOrUpdatePlan(DtPlan* aNewPlan);
74 
75 protected:
77  virtual void registerInterfaceMessageCallbacks();
78 
80  static void requestPlanListCallback(DtSimMessage* msg, void* usr);
81 
82  static void objectAddedCallback(const DtLocalObject* object, void* usr);
83 
85  virtual void objectAdded(const DtLocalObject* object);
86 
88  virtual void processObjectAboutToBeRemoved(const DtSimObject* object);
89 
91  static void setPlanCallback(DtSimMessage* msg, void* usr);
95  virtual void processSetPlan(DtSimMessage* msg);
96 
98  static void deletePlanCallback(DtSimMessage* msg, void* usr);
99 
102  virtual void processDeletePlan(DtSimMessage* msg);
103 
105  static void launchGlobalPlanCallback(DtSimMessage* msg, void* usr);
106 
109  virtual void processLaunchGlobalPlan(DtSimMessage* msg);
110 
115  virtual void setPlan(DtIfPlan* plan);
116 
119  virtual void watchPlan(DtPlan*);
120 
121  static void planStatementChangedCallback(const DtPlan&, void* usr);
122  virtual void processPlanStatementChanged(const DtPlan&);
123 
124  virtual bool processPlanStream(DtlInputStream*);
125 
126 private:
132  DtGlobalPlanManager& operator=(const DtGlobalPlanManager& orig);
133 
134 protected:
135  tbb::recursive_mutex myMutex;
137 
141 
142  typedef std::map<DtUUID, boost::signals2::connection> RemovalSignalsMap;
144 };
class DtIfPlan:
Definition: ifPlan.h:61
class DtLocalObjectManager:
Definition: localObjectManager.h:151
RemovalSignalsMap myRemovalSignalsMap
Definition: globalPlanManager.h:143
Contains the DtUUID class declaration.
DtSimulationServices * mySimulationServices
Definition: globalPlanManager.h:138
#define DT_DLL_vrfplanmgr
This file is used to determine how to build.
Definition: vrfplanmgrDefines.h:28
File: simMsg.h.
Definition: simMessage.h:35
const GlobalPlans & globalPlans() const
Accessor for the global plans currently in use on this back-end.
Definition: globalPlanManager.h:65
tbb::recursive_mutex myMutex
Definition: globalPlanManager.h:135
GlobalPlans myGlobalPlans
Definition: globalPlanManager.h:136
DtLocalObjectManager * myObjectManager
Definition: globalPlanManager.h:139
class DtPlan:
Definition: plan.h:92
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:88
boost::unordered_map< DtUUID, DtLocalObject * > GlobalPlans
Definition: globalPlanManager.h:48
class DtSimStatement:
Definition: simStatement.h:38
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
bool myReadingPlanFile
Definition: globalPlanManager.h:140
The global plan manager maintains the list of &quot;Global Plans.&quot; These are plans that are not specific t...
Definition: globalPlanManager.h:45
std::map< DtUUID, boost::signals2::connection > RemovalSignalsMap
Definition: globalPlanManager.h:142
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)