VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
UUIDNetworkManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
12 
13 #pragma once
14 
16 #include <vlutil/vlString.h>
17 #include <boost/unordered_map.hpp>
18 #include <vl/globalObjectDesignator.h>
19 #include <vrfutil/rwUUID.h>
20 #include <string>
21 #include <cstdio>
22 
24 #if WIN32 && _MSC_VER == 1400 || _MSC_VER == 1500
25 
26 #ifndef _INTPTR_T_DEFINED
27  #define _INTPTR_T_DEFINED
28  #ifdef _WIN64
29 typedef __int64 intptr_t;
30  #else /* _WIN64 */
31 typedef _W64 int intptr_t;
32  #endif /* _WIN64 */
33 #endif /* _INTPTR_T_DEFINED */
34 
35 #ifndef _UINTPTR_T_DEFINED
36  #define _UINTPTR_T_DEFINED
37  #ifdef _WIN64
38 typedef unsigned __int64 uintptr_t;
39  #else /* _WIN64 */
40 typedef _W64 unsigned int uintptr_t;
41  #endif /* _WIN64 */
42 #endif /* _UINTPTR_T_DEFINED */
43 
44 #else
45 #include <stdint.h>
46 #endif
47 
48 class DtExerciseConn;
51 
54 
57 class DtReflectedObject;
58 
59 #if DtHLA
60 namespace makVrfVrlinkExtToolkit
61 {
62  class DtReflectedExtendedAttributesObjectList;
63 }
64 #endif
65 
66 namespace makVrf
67 {
68  class DtNonVrfUUIDResolver;
69  typedef void (*DtUUIDChangedCallback)(DtReflectedObject*, const DtUUID& uuid, void* usr);
70 
72  {
73  public:
74 
77 
79  virtual ~DtUUIDNetworkManager();
80 
90  virtual void init(DtExerciseConn* exConn,
91  DtReflectedExtEntityList* reel = NULL,
92  DtReflectedExtAggregateList* ral = NULL,
93  DtReflectedControlObjectList* rel = NULL,
94  #if DtHLA
96  #endif
97  const DtString& uuidMarkingForNonVrForces = "entity-identifier");
98 
102  virtual void reinitialize(
103  DtReflectedExtEntityList* reel = NULL,
104  DtReflectedExtAggregateList* ral = NULL,
105  DtReflectedControlObjectList* rel = NULL
106  #if DtHLA
108  #endif
109  );
110 
113  virtual void setNonVrfUUIDResolver(DtNonVrfUUIDResolver*);
114  virtual DtNonVrfUUIDResolver* nonVrfUUIDResolver() const;
115 
118  virtual DtUUID uuidFor(DtReflectedExtEntity*) const;
119  virtual DtUUID uuidFor(DtReflectedExtAggregate*) const;
120  virtual DtUUID uuidFor(DtReflectedControlObject*) const;
121  virtual DtReflectedObject* reflectedObjectFor(const DtUUID&) const;
122 
123  DtReflectedControlObjectList* controlObjectList() { return myControlObjectList; };
124  DtReflectedExtEntityList* entityList() { return myEntityList; };
125  DtReflectedExtAggregateList* aggregateList() { return myAggregateList; };
126 
127  virtual void entityReflectedListDeleted();
128  virtual void aggregateReflectedListDeleted();
129  virtual void controlObjectReflectedListDeleted();
130 
132  virtual void addEntityUUIDChangedCallback(DtUUIDChangedCallback, void* usr);
133  virtual void removeEntityUUIDChangedCallback(DtUUIDChangedCallback, void* usr);
134 
135  virtual void addAggregateUUIDChangedCallback(DtUUIDChangedCallback, void* usr);
136  virtual void removeAggregateUUIDChangedCallback(DtUUIDChangedCallback, void* usr);
137 
138  virtual void addEnvironmentalUUIDChangedCallback(DtUUIDChangedCallback, void* usr);
139  virtual void removeEnvironmentalUUIDChangedCallback(DtUUIDChangedCallback, void* usr);
140 
141  protected:
143  virtual void initializeEntityList();
144  static void entityAddedCallback(DtReflectedExtEntity*, void* usr);
145  virtual void processEntityAdded(DtReflectedExtEntity*);
146  static void entityRemovedCallback(DtReflectedExtEntity*, void* usr);
147  virtual void processEntityRemoved(DtReflectedExtEntity*);
148  static void postEntityUpdateCallback(DtReflectedExtEntity*, void* usr);
149  virtual void processPostEntityUpdate(DtReflectedExtEntity*);
150 
151  virtual void initializeAggregateList();
152  static void aggregateAddedCallback(DtReflectedExtAggregate*, void* usr);
153  virtual void processAggregateAdded(DtReflectedExtAggregate*);
154  static void aggregateRemovedCallback(DtReflectedExtAggregate*, void* usr);
155  virtual void processAggregateRemoved(DtReflectedExtAggregate*);
156  static void postAggregateUpdateCallback(DtReflectedExtAggregate*, void* usr);
157  virtual void processPostAggregateUpdate(DtReflectedExtAggregate*);
158 
159  virtual void initializeControlObjectList();
160  static void controlObjectAddedCallback(DtReflectedControlObject*, void* usr);
161  virtual void processControlObjectAdded(DtReflectedControlObject*);
162  static void controlObjectRemovedCallback(DtReflectedControlObject*, void* usr);
163  virtual void processControlObjectRemoved(DtReflectedControlObject*);
164  static void postControlObjectUpdateCallback(DtReflectedControlObject*, void* usr);
165  virtual void processPostControlObjectUpdate(DtReflectedControlObject*);
166 
168  virtual void removeObject(const uintptr_t&);
169 
170  struct UUIDCallback;
171 
173  virtual void invokeUUIDCallbacks(std::vector<UUIDCallback>, DtReflectedObject*, const DtUUID&);
174 
175  virtual void addUUIDCallback(std::vector<UUIDCallback>&, DtUUIDChangedCallback, void*);
176  virtual void removeUUIDCallback(std::vector<UUIDCallback>&, DtUUIDChangedCallback, void*);
177 
178  protected:
179  DtExerciseConn* myExerciseConnection;
182 
185 
188 
189  #if DtHLA
192  #endif
193 
195 
196  typedef boost::unordered_map<uintptr_t, DtUUID> CurrentDataMap;
198 
199  typedef boost::unordered_map<DtUUID, DtReflectedObject*> CurrentReflectedObjectMap;
201 
202  typedef boost::unordered_map<uintptr_t, int> DataUpdateTrackerCount;
204 
207 
209  {
211  void* user;
212  };
213 
214  std::vector<UUIDCallback> myEntityUUIDChangedCallbacks;
215  std::vector<UUIDCallback> myAggregateUUIDChangedCallbacks;
216  std::vector<UUIDCallback> myEnvironmentalUUIDChangedCallbacks;
217  };
218 }
DtReflectedControlObjectList * myControlObjectList
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:180
UUID is a unique ID wrapper class.
Definition: uuid.h:59
DtReflectedExtAggregateList * aggregateList()
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:125
Definition: reflectedExtEntity.h:31
DtReflectedExtEntityList * entityList()
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:124
Definition: UUIDNetworkManager.h:208
DtReflectedExtAggregateList * myAggregateList
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:186
Definition: reflectedExtAggregate.h:35
boost::unordered_map< DtUUID, DtReflectedObject * > CurrentReflectedObjectMap
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:199
boost::unordered_map< uintptr_t, DtUUID > CurrentDataMap
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:196
bool myOwnsNonVrfUUIDResolver
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:206
void * user
Definition: UUIDNetworkManager.h:211
DtExerciseConn * myExerciseConnection
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:179
DtNonVrfUUIDResolver * myNonVrfUUIDResolver
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:205
Contains the DtUUID class declaration.
DtUUIDChangedCallback callback
Definition: UUIDNetworkManager.h:210
DtString myNonVrfObjectsUUIDScheme
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:194
class DtReflectedControlObjectList:
Definition: reflectedControlObjectList.h:23
DtReflectedControlObjectList * controlObjectList()
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:123
void(* DtUUIDChangedCallback)(DtReflectedObject *, const DtUUID &uuid, void *usr)
Definition: UUIDNetworkManager.h:69
Definition: nonVrfUUIDResolver.h:24
CurrentDataMap myCurrentDataMap
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:197
std::vector< UUIDCallback > myAggregateUUIDChangedCallbacks
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:215
bool myOwnsControlObjectList
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:181
bool myOwnsAggregateList
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:187
Definition: UUIDNetworkManager.h:71
std::vector< UUIDCallback > myEntityUUIDChangedCallbacks
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:214
DtReflectedExtEntityList * myEntityList
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:183
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
bool myOwnsExtAttributesList
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:191
boost::unordered_map< uintptr_t, int > DataUpdateTrackerCount
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:202
class DtReflectedExtAggregateList:
Definition: reflectedExtAggregateList.h:27
CurrentReflectedObjectMap myReflectedObjectMap
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:200
makVrfVrlinkExtToolkit::DtReflectedExtendedAttributesObjectList * myExtAttributesList
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:190
std::vector< UUIDCallback > myEnvironmentalUUIDChangedCallbacks
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:216
Definition: reflectedControlObject.h:26
DataUpdateTrackerCount myDataUpdateTrackerCount
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:203
class DtReflectedExtAggregateList:
Definition: reflectedExtEntityList.h:27
bool myOwnsEntityList
Supply all reflected lists if you are creating them in order to populate the DtUUIDNetworkManager to ...
Definition: UUIDNetworkManager.h:184

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)