VR-Forces 5.0.3 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 
13 #include <vrfutil/rwUUID.h>
14 #include <boost/unordered_map.hpp>
15 
17 class DtSimMessage;
18 class DtLocalObject;
20 
23 
25 {
27  bool isEnabled;
28 };
30 
34 {
35 public:
38 
40  virtual ~DtScenarioEventManager();
41 
42 private:
45 
47  DtScenarioEventManager & operator=(const DtScenarioEventManager & orig);
48 
49 public:
51  virtual bool isScenarioEvent(const DtUUID& o) const;
52 
54 
55  virtual void addScenarioEventStartedCallback(DtScenarioEventManagerCallbackFcn fcn, void* usr);
56  virtual void removeScenarioEventStartedCallback(DtScenarioEventManagerCallbackFcn fcn, void* usr);
58 
60 
61  virtual void addScenarioEventEnabledStateChangedCallback(DtScenarioEventManagerEnabledStateChangedCallbackFcn fcn, void* usr);
62  virtual void removeScenarioEventEnabledStateChangedCallback(DtScenarioEventManagerEnabledStateChangedCallbackFcn fcn, void* usr);
64 
66 
67  virtual void addScenarioEventStoppedCallback(DtScenarioEventManagerCallbackFcn fcn, void* usr);
68  virtual void removeScenarioEventStoppedCallback(DtScenarioEventManagerCallbackFcn fcn, void* usr);
70 
72  static void scenarioEventMessageCallback(DtSimMessage*, void* usr);
73  virtual void processScenarioEventMessageCallback(DtSimMessage*);
74 
76  virtual void setScenarioEventEnabled(const DtUUID&, bool, bool sendMessageIfNotLocal = true);
77 
79  virtual bool scenarioEventIsEnabled(const DtUUID&);
80 
83  virtual void startScenarioEvent(const DtUUID&, bool sendMessageIfNotLocal = true);
84 
87  virtual void stopScenarioEvent(const DtUUID&, bool sendMessageIfNotLocal = true);
88 
90  virtual bool scenarioEventInProgress(const DtUUID&) const;
91 
93  virtual bool scenarioEventIsConcluded(const DtUUID&) const;
94 
96  virtual bool scenarioEventConcluded(const DtUUID&) const;
97 
99  virtual const DtRwScenarioEvent& scenarioEvent(const DtUUID&) const;
100 
102  virtual double simulationStartTime(const DtUUID&) const;
103 
105  virtual double simulationEndTime(const DtUUID&) const;
106 
108  static void scenarioEventAdded(const DtLocalObject*, void*);
109  virtual void processScenarioEventAdded(const DtLocalObject*);
110 
112  static void scenarioEventRemoved(const DtLocalObject*, void*);
113  virtual void processScenarioEventRemoved(const DtLocalObject*);
114 
116  virtual void setOrdinalOrder(const DtUUID& uniqueId, int ordinal);
117 
119  virtual void resetScenarioEvent(const DtUUID& uniqueId, bool sendMessageIfNotLocal = true);
120 
122  virtual void setTriggerStatus(const DtUUID& uniqueId, int);
123 
125  virtual void merge(DtScenarioEventManager*, const DtString& deconflictingName);
126 
128  {
131  };
132 
133  typedef std::map<const DtLocalObject*, EventUpdateInformation> EventsThatNeedUpdate;
134 
136  {
137  return myEventsThatNeedUpdate;
138  }
139 
141  {
142  return myEventsThatNeedUpdate;
143  }
144 
145 protected:
147  virtual void startUpEvent(const DtUUID& uniqueId);
148 
150  virtual void stopEvent(const DtUUID& uniqueId);
151 
154  virtual void updateEnabledStatesLinkedTo(const DtUUID&);
155 
157  virtual DtUUID scenarioEventUUIDBasedOf(const DtUUID&) const;
158 
159  virtual void processObjectModifiedViaMessage(DtLocalObject* o);
160 
162  virtual bool isThisObjectLinkedToMe(const DtUUID& source, const DtUUID& dest) const;
163 
164 protected:
167 
171 
174 
178  {
179  ScenarioEventInformation() : scenarioEvent(0), rwEvent(""), curLinkedTo(DtUUID::nullUUID()) {};
180 
181  DtLocalObject* scenarioEvent;
185  };
186 
187  typedef std::map<DtUUID, ScenarioEventInformation> ScenarioEvents;
189 
190  typedef std::map<DtUUID, DtUUID> ObjectEvents;
192 
194 
196 };
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
class DtLocalObjectManager:
Definition: localObjectManager.h:151
Definition: scenarioEventManager.h:127
DtLocalObjectManager * myObjectManager
Definition: scenarioEventManager.h:166
DtCallbackList< DtEnableStateChanged > ScenarioEventEnableStateChangedCallbacks
Definition: scenarioEventManager.h:172
ScenarioEventCallbacks myScenarioEventStoppedCallbacks
Definition: scenarioEventManager.h:170
DtRwScenarioEvent::PredecessorList linkList
Definition: scenarioEventManager.h:130
DtCallbackList< DtEnableStateChanged >::DtCallbackFunctionType DtScenarioEventManagerEnabledStateChangedCallbackFcn
Definition: scenarioEventManager.h:29
std::vector< PredecessorItem > PredecessorList
Definition: rwScenarioEvent.h:160
bool isEnabled
Definition: scenarioEventManager.h:27
DtRwScenarioEvent * scenarioEvent
Definition: scenarioEventManager.h:129
DtUUID curLinkedTo
Definition: scenarioEventManager.h:184
EventsThatNeedUpdate & eventsThatNeedUpdate()
Definition: scenarioEventManager.h:140
Contains the DtUUID class declaration.
EventsThatNeedUpdate myEventsThatNeedUpdate
Definition: scenarioEventManager.h:193
int myMaxOrdinal
Definition: scenarioEventManager.h:195
Definition: scenarioEventManager.h:24
DtCallbackList< const DtUUID & >::DtCallbackFunctionType DtScenarioEventManagerCallbackFcn
Callback function definition for any kind of scripted task change.
Definition: scenarioEventManager.h:19
The scenario event manager will keep track of all scenario event objects and their state...
Definition: scenarioEventManager.h:33
DtUUID uuid
Definition: scenarioEventManager.h:26
std::map< DtUUID, DtUUID > ObjectEvents
Definition: scenarioEventManager.h:190
#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:133
Definition: noArgumentCallbackList.h:91
ScenarioEventEnableStateChangedCallbacks myScenarioEventEnabledStateChangedCallbacks
Definition: scenarioEventManager.h:173
const char * source
Definition: lz4.h:442
std::map< DtUUID, ScenarioEventInformation > ScenarioEvents
Definition: scenarioEventManager.h:187
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:165
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
const EventsThatNeedUpdate & eventsThatNeedUpdate() const
Definition: scenarioEventManager.h:135
ObjectEvents myObjectEvents
Definition: scenarioEventManager.h:191
DtString rwData
Definition: scenarioEventManager.h:183
DtCallbackList< const DtUUID & > ScenarioEventCallbacks
Definition: scenarioEventManager.h:168
ScenarioEvents myScenarioEvents
Definition: scenarioEventManager.h:188
DtRwScenarioEvent rwEvent
Definition: scenarioEventManager.h:182
ScenarioEventInformation()
Definition: scenarioEventManager.h:179
ScenarioEventCallbacks myScenarioEventStartedCallbacks
Definition: scenarioEventManager.h:169
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
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:177

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)