VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
scenarioEventManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 #pragma once
9 
14 #include <vrfutil/rwUUID.h>
15 
16 #include <boost/signals2.hpp>
17 #include <boost/unordered_map.hpp>
18 
20 class DtSimMessage;
21 class DtLocalObject;
23 
26 
28 {
30  bool isEnabled;
31 };
33 
37 {
38 public:
41 
43  virtual ~DtScenarioEventManager();
44 
45 private:
48 
50  DtScenarioEventManager & operator=(const DtScenarioEventManager & orig);
51 
52 public:
54  virtual bool isScenarioEvent(const DtUUID& o) const;
55 
57 
58  virtual void addScenarioEventStartedCallback(DtScenarioEventManagerCallbackFcn fcn, void* usr);
59  virtual void removeScenarioEventStartedCallback(DtScenarioEventManagerCallbackFcn fcn, void* usr);
61 
63 
64  virtual void addScenarioEventEnabledStateChangedCallback(DtScenarioEventManagerEnabledStateChangedCallbackFcn fcn, void* usr);
65  virtual void removeScenarioEventEnabledStateChangedCallback(DtScenarioEventManagerEnabledStateChangedCallbackFcn fcn, void* usr);
67 
69 
70  virtual void addScenarioEventStoppedCallback(DtScenarioEventManagerCallbackFcn fcn, void* usr);
71  virtual void removeScenarioEventStoppedCallback(DtScenarioEventManagerCallbackFcn fcn, void* usr);
73 
75  static void scenarioEventMessageCallback(DtSimMessage*, void* usr);
76  virtual void processScenarioEventMessageCallback(DtSimMessage*);
77 
79  virtual void setScenarioEventEnabled(const DtUUID&, bool, bool sendMessageIfNotLocal = true);
80 
82  virtual bool scenarioEventIsEnabled(const DtUUID&) const;
83 
86  virtual void startScenarioEvent(const DtUUID&, bool sendMessageIfNotLocal = true);
87 
90  virtual void stopScenarioEvent(const DtUUID&, bool sendMessageIfNotLocal = true);
91 
93  virtual bool scenarioEventInProgress(const DtUUID&) const;
94 
96  virtual bool scenarioEventIsConcluded(const DtUUID&) const;
97 
99  virtual bool scenarioEventConcluded(const DtUUID&) const;
100 
102  virtual const DtRwScenarioEvent& scenarioEvent(const DtUUID&) const;
103 
105  virtual const DtRwScenarioEvent& nextFrameScenarioEvent(const DtUUID&) const;
106 
108  virtual double simulationStartTime(const DtUUID&) const;
109 
111  virtual double simulationEndTime(const DtUUID&) const;
112 
114  static void scenarioEventAdded(const DtLocalObject*, void*);
115  virtual void processScenarioEventAdded(const DtLocalObject*);
116 
118  static void scenarioEventRemoved(const DtLocalObject*, void*);
119  virtual void processScenarioEventRemoved(const DtLocalObject*);
120 
122  virtual void setOrdinalOrder(const DtUUID& uniqueId, int ordinal);
123 
125  virtual void resetScenarioEvent(const DtUUID& uniqueId, bool sendMessageIfNotLocal = true);
126 
128  virtual void setTriggerStatus(const DtUUID& uniqueId, int);
129 
131  virtual void merge(DtScenarioEventManager*, const DtString& deconflictingName);
132 
134  {
137  };
138 
139  typedef std::map<const DtLocalObject*, EventUpdateInformation> EventsThatNeedUpdate;
140 
142  {
143  return myEventsThatNeedUpdate;
144  }
145 
147  {
148  return myEventsThatNeedUpdate;
149  }
150 
151 protected:
152  virtual void updateScenarioEvents();
153 
155  virtual void startUpEvent(const DtUUID& uniqueId);
156 
158  virtual void stopEvent(const DtUUID& uniqueId);
159 
162  virtual void updateEnabledStatesLinkedTo(const DtUUID&);
163 
165  virtual DtUUID scenarioEventUUIDBasedOf(const DtUUID&) const;
166 
167  virtual void processObjectModifiedViaMessage(DtLocalObject* o);
168 
170  virtual bool isThisObjectLinkedToMe(const DtUUID& source, const DtUUID& dest) const;
171 
172  virtual void slot_simObjectAdded(DtSimObjectReference);
173  virtual void slot_simObjectDeleted(DtSimObjectReference);
174  virtual void slot_eventDataModified(const DtSimObject*);
175 
176 protected:
179 
183 
186 
190  {
191  LocalScenarioEventInformation() : scenarioEvent(0), rwEvent(""), curLinkedTo(DtUUID::nullUUID()) {};
192 
193  DtLocalObject* scenarioEvent;
197  };
198 
199  typedef std::map<DtUUID, LocalScenarioEventInformation> LocalScenarioEvents;
201 
203  {
205 
206  DtRwScenarioEvent rwEvent;
208  boost::signals2::connection updateConnection;
209  boost::signals2::connection deletedConnection;
210  };
211 
212  typedef std::map<DtUUID, CurrentFrameScenarioEventInformation> CurrentFrameScenarioEvents;
214 
215  typedef std::map<DtUUID, DtUUID> ObjectEvents;
217 
219 
221  boost::signals2::scoped_connection mySimObjectAddedConnection;
222  boost::signals2::scoped_connection myUpdateScenarioEventsConnection;
223  boost::signals2::scoped_connection myAdvancedFrameConnection;
225 };
UUID is a unique ID wrapper class.
Definition: uuid.h:59
std::set< DtUUID > myUpdateUpdateEnabledStateLinkedTo
Definition: scenarioEventManager.h:224
class DtLocalObjectManager:
Definition: localObjectManager.h:151
Definition: scenarioEventManager.h:133
DtLocalObjectManager * myObjectManager
Definition: scenarioEventManager.h:178
LocalScenarioEvents myLocalScenarioEvents
Definition: scenarioEventManager.h:200
DtCallbackList< DtEnableStateChanged > ScenarioEventEnableStateChangedCallbacks
Definition: scenarioEventManager.h:184
Information that is really only needed to keep track of status of scenario events. All other information is part of the extended scenario event data.
Definition: scenarioEventManager.h:189
DtString rwData
Definition: scenarioEventManager.h:207
ScenarioEventCallbacks myScenarioEventStoppedCallbacks
Definition: scenarioEventManager.h:182
DtRwScenarioEvent::PredecessorList linkList
Definition: scenarioEventManager.h:136
DtCallbackList< DtEnableStateChanged >::DtCallbackFunctionType DtScenarioEventManagerEnabledStateChangedCallbackFcn
Definition: scenarioEventManager.h:32
DtUUID curLinkedTo
Definition: scenarioEventManager.h:196
std::vector< PredecessorItem > PredecessorList
Definition: rwScenarioEvent.h:160
bool isEnabled
Definition: scenarioEventManager.h:30
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
boost::signals2::scoped_connection mySimObjectAddedConnection
Definition: scenarioEventManager.h:221
DtRwScenarioEvent * scenarioEvent
Definition: scenarioEventManager.h:135
EventsThatNeedUpdate & eventsThatNeedUpdate()
Definition: scenarioEventManager.h:146
Contains the DtUUID class declaration.
EventsThatNeedUpdate myEventsThatNeedUpdate
Definition: scenarioEventManager.h:218
int myMaxOrdinal
Definition: scenarioEventManager.h:220
boost::signals2::connection updateConnection
Definition: scenarioEventManager.h:208
Definition: scenarioEventManager.h:27
DtCallbackList< const DtUUID & >::DtCallbackFunctionType DtScenarioEventManagerCallbackFcn
Callback function definition for any kind of scripted task change.
Definition: scenarioEventManager.h:22
The scenario event manager will keep track of all scenario event objects and their state...
Definition: scenarioEventManager.h:36
DtUUID uuid
Definition: scenarioEventManager.h:29
std::map< DtUUID, DtUUID > ObjectEvents
Definition: scenarioEventManager.h:215
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
File: simMsg.h.
Definition: simMessage.h:35
std::map< const DtLocalObject *, EventUpdateInformation > EventsThatNeedUpdate
Definition: scenarioEventManager.h:139
Definition: noArgumentCallbackList.h:90
CurrentFrameScenarioEvents myCurrentFrameScenarioEvents
Definition: scenarioEventManager.h:213
ScenarioEventEnableStateChangedCallbacks myScenarioEventEnabledStateChangedCallbacks
Definition: scenarioEventManager.h:185
DtRwScenarioEvent rwEvent
Definition: scenarioEventManager.h:194
const char * source
Definition: lz4.h:442
The DtRwScenarioEvent class will define the contents of a scenario event and it&#39;s current status...
Definition: rwScenarioEvent.h:68
DtSimulationServices * mySimulationServices
Definition: scenarioEventManager.h:177
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
const EventsThatNeedUpdate & eventsThatNeedUpdate() const
Definition: scenarioEventManager.h:141
boost::signals2::scoped_connection myAdvancedFrameConnection
Definition: scenarioEventManager.h:223
ObjectEvents myObjectEvents
Definition: scenarioEventManager.h:216
DtString rwData
Definition: scenarioEventManager.h:195
std::map< DtUUID, LocalScenarioEventInformation > LocalScenarioEvents
Definition: scenarioEventManager.h:199
Contains the DtSimObjectReference class declaration.
std::map< DtUUID, CurrentFrameScenarioEventInformation > CurrentFrameScenarioEvents
Definition: scenarioEventManager.h:212
boost::signals2::scoped_connection myUpdateScenarioEventsConnection
Definition: scenarioEventManager.h:222
DtCallbackList< const DtUUID & > ScenarioEventCallbacks
Definition: scenarioEventManager.h:180
ScenarioEventCallbacks myScenarioEventStartedCallbacks
Definition: scenarioEventManager.h:181
boost::signals2::connection deletedConnection
Definition: scenarioEventManager.h:209
char * dest
Definition: lz4.h:440
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)