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 
13 //vrf includes
15 
16 #include <vrfutil/rwUUID.h>
17 
18 #include <boost/signals2.hpp>
19 
21 #include <vlutil/vlString.h>
22 
24 #include <mutex>
25 
27 #include <map>
28 #include <vector>
29 #include <unordered_map>
30 
31 class DtLocalObject;
32 class DtSimObject;
33 class DtPlan;
34 class DtSimStatement;
35 class DtIfPlan;
36 class DtString;
39 class DtSimMessage;
40 class DtlInputStream;
41 
54 {
55 public:
56  typedef std::unordered_map<DtUUID, DtLocalObject*> GlobalPlans;
57 
58 public:
61 
63  virtual ~DtGlobalPlanManager();
64 
65  virtual bool init();
66 
69  virtual bool readPlanFile(const DtString& filename);
70  virtual bool readPlanFileFromZipFile(const DtFilename& scenarioZipFile, const DtString& filename);
71 
73  const GlobalPlans& globalPlans() const { return myGlobalPlans; };
74 
76  virtual void sendPlanList();
77 
78  virtual void completeInitialization();
79 
81  virtual void addOrUpdatePlan(DtPlan* aNewPlan);
82 
83 protected:
85  virtual void registerInterfaceMessageCallbacks();
86 
88  static void requestPlanListCallback(DtSimMessage* msg, void* usr);
89 
90  static void objectAddedCallback(const DtLocalObject* object, void* usr);
91 
93  virtual void objectAdded(const DtLocalObject* object);
94 
96  virtual void processObjectAboutToBeRemoved(const DtSimObject* object);
97  virtual void processObjectNameChanged(const DtSimObject* object);
98 
100  static void setPlanCallback(DtSimMessage* msg, void* usr);
104  virtual void processSetPlan(DtSimMessage* msg);
105 
107  static void deletePlanCallback(DtSimMessage* msg, void* usr);
108 
111  virtual void processDeletePlan(DtSimMessage* msg);
112 
114  static void launchGlobalPlanCallback(DtSimMessage* msg, void* usr);
115 
118  virtual void processLaunchGlobalPlan(DtSimMessage* msg);
119 
124  virtual void setPlan(DtIfPlan* plan);
125 
128  virtual void watchPlan(DtPlan*);
129 
130  static void planStatementChangedCallback(const DtPlan&, void* usr);
131  virtual void processPlanStatementChanged(const DtPlan&);
132 
133  virtual bool processPlanStream(DtlInputStream*);
134 
135 private:
141  DtGlobalPlanManager& operator=(const DtGlobalPlanManager& orig);
142 
143 protected:
144  std::recursive_mutex myMutex;
146 
150 
151  struct Signals
152  {
153  boost::signals2::connection removalConnection;
154  boost::signals2::connection nameChangedConnection;
155  };
156 
157  typedef std::map<DtUUID, Signals> SignalsMap;
159 };
class DtIfPlan:
Definition: ifPlan.h:61
class DtLocalObjectManager:
Definition: localObjectManager.h:157
Definition: globalPlanManager.h:151
boost::signals2::connection removalConnection
Definition: globalPlanManager.h:153
Contains the DtUUID class declaration.
SignalsMap mySignalsMap
Definition: globalPlanManager.h:158
DtSimulationServices * mySimulationServices
Definition: globalPlanManager.h:147
#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:73
GlobalPlans myGlobalPlans
Definition: globalPlanManager.h:145
DtLocalObjectManager * myObjectManager
Definition: globalPlanManager.h:148
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:96
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:80
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:149
boost::signals2::connection nameChangedConnection
Definition: globalPlanManager.h:154
std::unordered_map< DtUUID, DtLocalObject * > GlobalPlans
Definition: globalPlanManager.h:56
The global plan manager maintains the list of &quot;Global Plans.&quot; These are plans that are not specific t...
Definition: globalPlanManager.h:53
std::map< DtUUID, Signals > SignalsMap
Definition: globalPlanManager.h:157
A locally simulated VRF object.
Definition: localObject.h:98
std::recursive_mutex myMutex
Definition: globalPlanManager.h:144

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)