VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
organizationManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 
11 #include <vlutil/vlConfig.h>
12 #include <vector>
15 #include "vrfutil/rwUUID.h"
16 
18 
21 class DtPrintPendingOpsCommand;
22 class DtDeletePendingOpsCommand;
23 
24 typedef void (*DtOrganizationManagerCallbackFcn)(void* usr);
25 
28 {
29  bool myReady;
30 };
31 
35 
47 {
48 private:
55 
56 public:
58 
59 public:
60 
64  virtual ~DtOrganizationManager();
65 
66  virtual bool init();
67 
71 
73  virtual DtOrganizationManagerNode* addEntity(const DtVrfObject *vrfObject);
74 
76  virtual void removeEntity(const DtVrfObject *vrfObject);
77 
79  virtual void updateAggregate(const DtVrfObject *vrfObject);
80 
82  virtual void updateEntity(const DtVrfObject *vrfObject);
83 
88  virtual void setSuperior(const DtUUID& subordinate,
89  const DtUUID& superior, int designator = 0,
90  bool localOnly = false);
91 
96  virtual void setSuperiorToForce(const DtUUID& subordinate,
97  int designator = 0, bool localOnly = false);
98 
106  virtual void queueSetSuperior(const DtUUID& subordinate,
107  const DtUUID& superior, int designator = 0,
108  DtOrganizationManagerCallbackFcn completionCallback = 0, void* usrData = 0);
109 
117  virtual void queueSetSuperiorToForce(const DtUUID& subordinate,
118  int designator = 0, DtOrganizationManagerCallbackFcn completionCallback = 0, void* usrData = 0);
119 
124  virtual void queueChangeSet(const DtOrganizationChangeSet& changeSet, int& changeSetRequestId,
125  DtOrganizationManagerCallbackFcn completionCallback = 0, void* usrData = 0);
126 
127  virtual void removeChangeSetCallback(int changeSetRequestId,
128  DtOrganizationManagerCallbackFcn completionCallback, void* usrData = 0) const;
129 
133  virtual void detatchFromSuperior(const DtUUID& subordinate,
134  bool localOnly = false);
135 
138  virtual void setSubordinateOrder(const DtUUID& superior,
139  const std::vector<DtEntityIdentifier>& orderedSubordinateList,
140  bool localOnly = false);
141 
142  static void addToOrganizationCallback(DtSimMessage* msg, void* usr);
143  static void removeFromOrganizationCallback(DtSimMessage* msg, void* usr);
144 
148  virtual bool allLocalOrgChangesComplete() const;
149 
151  virtual bool hasPendingOperations() const;
152 
154  virtual void addOrganizationManagerReadyCallback(
155  DtOrganizationManagerReadyCallbackFcn fcn, void* usrData);
156 
158  virtual void removeOrganizationManagerReadyCallback(
159  DtOrganizationManagerReadyCallbackFcn fcn, void* usrData);
160 
162  virtual void runPendingOperations();
163 
164  virtual void printPendingOperations() const;
165 
166  virtual void deletePendingOperations();
167 
168  virtual void deletePendingOperationsFor(DtString objectName);
169 
171  int numberOfOperations() const { return myPendingOperationList.count(); };
172 
174  virtual void closingScenario();
175 
176 protected:
178  virtual void invokeOrganizationManagerReadyCallbacks();
179 
180  virtual void processAddToOrganization(DtSimMessage* msg);
181  virtual void processRemoveFromOrganization(DtSimMessage* msg);
182 
185  virtual bool setSuperiorIsLocal(const DtUUID& subordinate,
186  const DtUUID& superiorId);
187 
190  virtual bool setSuperiorToForceIsLocal(const DtUUID& subordinate);
191 
193  virtual bool detatchFromSuperiorIsLocal(const DtUUID& subordinate);
194 
196  virtual bool setSubordinateOrderIsLocal(const DtUUID& superior) const;
197 
200  virtual void addOperationToQueue(DtOrgManagerOperation* operation);
201 
204  virtual unsigned int newPendingOperationId();
205 
206  virtual void clearPendingOperationId(unsigned int id);
207 
208  static void pendingOperationCompleteCallback(void* usr);
209 
210  static int nextId();
211 
212 protected:
214  typedef std::pair<DtOrganizationManager*, unsigned int> DtPendingOperationCompletionCallbackData;
215 
218 
221 
222  std::list<unsigned int> myPendingOperationIdList;
224 
226 
227  DtPrintPendingOpsCommand* myPrintPendingOpsCommand;
228  DtDeletePendingOpsCommand* myDeletePendingOpsCommand;
229 
230  static int theNextId;
231 
232 };
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
DtOrganizationChangeSet.
Definition: organizationChangeSet.h:21
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
Definition: organizationManagerNode.h:64
DtList myPendingOperationList
List of DtOrgManagerOperations which have not been successfully executed yet.
Definition: organizationManager.h:217
DtDeletePendingOpsCommand * myDeletePendingOpsCommand
Definition: organizationManager.h:228
bool myReady
Definition: organizationManager.h:29
int numberOfOperations() const
Number of operations that are pending.
Definition: organizationManager.h:171
DtOrganizationReadyCallbackList myOrganizationManagerReadyCallbackList
Definition: organizationManager.h:225
This class maintains a hierarchy of the existing organized entities for a simulation based on the con...
Definition: organizationView.h:42
DtCallbackList< const DtOrganizationManagerReadyCallbackInfo & >::DtCallbackFunctionType DtOrganizationManagerReadyCallbackFcn
Callback function definition for organization manager readiness state change.
Definition: organizationManager.h:34
std::pair< DtOrganizationManager *, unsigned int > DtPendingOperationCompletionCallbackData
Structure used in the userData field of the pending operation callbacks.
Definition: organizationManager.h:214
void(* DtOrganizationManagerCallbackFcn)(void *usr)
Definition: organizationManager.h:24
DtSimInterfaceMessage is used to send a message to the front end or the back end. ...
Definition: simInterfaceMessage.h:32
virtual void updateEntity(const DtVrfObject *vrfObject)
Updates the connections to the node corresponding to this entity.
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
virtual DtOrganizationManagerNode * addEntity(const DtVrfObject *vrfObject)
Functions for manipulating the hierarchy.
File: simMsg.h.
Definition: simMessage.h:35
bool myOperationsRunning
Flag to prevent reentrance of runPendingOperations.
Definition: organizationManager.h:220
Definition: noArgumentCallbackList.h:91
virtual void updateAggregate(const DtVrfObject *vrfObject)
Updates the connections to the node corresponding to this aggregate.
DtCallbackList< const DtOrganizationManagerReadyCallbackInfo & > DtOrganizationReadyCallbackList
Definition: organizationManager.h:57
virtual bool init()
unsigned int myNextPendingOperationId
Definition: organizationManager.h:223
This class derives from the DtOrganizationView, and adds the capability to manipulate the hierarchy...
Definition: organizationManager.h:46
class DtVrfObjectManager:
Definition: vrfObjectManager.h:202
Definition: orgManagerOperations.h:18
std::list< unsigned int > myPendingOperationIdList
Definition: organizationManager.h:222
DtOrganizationView & operator=(const DtOrganizationView &orig)
Assignment operator not implemented.
static int theNextId
Definition: organizationManager.h:230
virtual void removeEntity(const DtVrfObject *vrfObject)
Removes the node for this entity from the hierarchy.
DtPrintPendingOpsCommand * myPrintPendingOpsCommand
Definition: organizationManager.h:227
Container used in callback lists.
Definition: organizationManager.h:27

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)