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  virtual void processObjectNameChanged(const DtSimObject* object);
90 
92  static void setPlanCallback(DtSimMessage* msg, void* usr);
96  virtual void processSetPlan(DtSimMessage* msg);
97 
99  static void deletePlanCallback(DtSimMessage* msg, void* usr);
100 
103  virtual void processDeletePlan(DtSimMessage* msg);
104 
106  static void launchGlobalPlanCallback(DtSimMessage* msg, void* usr);
107 
110  virtual void processLaunchGlobalPlan(DtSimMessage* msg);
111 
116  virtual void setPlan(DtIfPlan* plan);
117 
120  virtual void watchPlan(DtPlan*);
121 
122  static void planStatementChangedCallback(const DtPlan&, void* usr);
123  virtual void processPlanStatementChanged(const DtPlan&);
124 
125  virtual bool processPlanStream(DtlInputStream*);
126 
127 private:
133  DtGlobalPlanManager& operator=(const DtGlobalPlanManager& orig);
134 
135 protected:
136  tbb::recursive_mutex myMutex;
138 
142 
143  struct Signals
144  {
145  boost::signals2::connection removalConnection;
146  boost::signals2::connection nameChangedConnection;
147  };
148 
149  typedef std::map<DtUUID, Signals> SignalsMap;
151 };
class DtIfPlan:
Definition: ifPlan.h:61
class DtLocalObjectManager:
Definition: localObjectManager.h:151
Definition: globalPlanManager.h:143
boost::signals2::connection removalConnection
Definition: globalPlanManager.h:145
Contains the DtUUID class declaration.
SignalsMap mySignalsMap
Definition: globalPlanManager.h:150
DtSimulationServices * mySimulationServices
Definition: globalPlanManager.h:139
#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:136
GlobalPlans myGlobalPlans
Definition: globalPlanManager.h:137
DtLocalObjectManager * myObjectManager
Definition: globalPlanManager.h:140
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:95
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:141
boost::signals2::connection nameChangedConnection
Definition: globalPlanManager.h:146
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, Signals > SignalsMap
Definition: globalPlanManager.h:149
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 Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)