VR-Forces 4.1 Class Documentation
orgManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2002 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: orgManager.h,v $ $Revision: 1.18 $ $State: Exp $
7 *******************************************************************************/
8 #ifndef orgManager_H_
9 #define orgManager_H_
10 
13 
14 #include <vlutil/vlConfig.h>
15 #include <vector>
16 #include "vrfobjcore/orgView.h"
17 #include "vrfutil/callbackList.h"
19 
21 
24 class DtPrintPendingOpsCommand;
25 class DtDeletePendingOpsCommand;
26 
27 typedef void (*DtOrganizationManagerCallbackFcn)(void* usr);
28 
31 {
32  bool myReady;
33 };
34 
38 
48 {
49 private:
56 
57 public:
59 
60 public:
61 
65  virtual ~DtOrganizationManager();
66 
67  virtual bool init();
68 
72 
74  virtual DtOrganizationManagerNode* addEntity(DtVrfObject *vrfObject);
75 
77  virtual void removeEntity(DtVrfObject *vrfObject);
78 
80  virtual void updateAggregate(DtVrfObject *vrfObject);
81 
83  virtual void updateEntity(DtVrfObject *vrfObject);
84 
89  virtual void setSuperior(const DtEntityIdentifier& subordinateId,
90  const DtEntityIdentifier& superiorId, int designator = 0,
91  bool localOnly = false);
92 
97  virtual void setSuperiorToForce(const DtEntityIdentifier& subordinateId,
98  int designator = 0, bool localOnly = false);
99 
107  virtual void queueSetSuperior(const DtString& subordinateName,
108  const DtString& superiorName, int designator = 0,
109  DtOrganizationManagerCallbackFcn completionCallback = 0, void* usrData = 0);
110 
118  virtual void queueSetSuperiorToForce(const DtString& subordinateName,
119  int designator = 0, DtOrganizationManagerCallbackFcn completionCallback = 0, void* usrData = 0);
120 
125  virtual void queueChangeSet(const DtOrganizationChangeSet& changeSet, int& changeSetRequestId,
126  DtOrganizationManagerCallbackFcn completionCallback = 0, void* usrData = 0);
127 
128  virtual void removeChangeSetCallback(int changeSetRequestId,
129  DtOrganizationManagerCallbackFcn completionCallback, void* usrData = 0);
130 
134  virtual void detatchFromSuperior(const DtEntityIdentifier& subordinateId,
135  bool localOnly = false);
136 
139  virtual void setSubordinateOrder(const DtEntityIdentifier& superiorId,
140  const std::vector<DtEntityIdentifier>& orderedSubordinateList,
141  bool localOnly = false);
142 
143  static void addToOrganizationCallback(DtSimMessage* msg, void* usr);
144  static void removeFromOrganizationCallback(DtSimMessage* msg, void* usr);
145 
149  static void objectAboutToBeRemovedCallback(DtVrfObject* vrfObject,
150  void* usr);
151  virtual void processObjectAboutToBeRemoved();
152 
156  virtual bool allLocalOrgChangesComplete() const;
157 
159  virtual bool hasPendingOperations() const;
160 
162  virtual void addOrganizationManagerReadyCallback(
163  DtOrganizationManagerReadyCallbackFcn fcn, void* usrData);
164 
166  virtual void removeOrganizationManagerReadyCallback(
167  DtOrganizationManagerReadyCallbackFcn fcn, void* usrData);
168 
170  virtual void runPendingOperations();
171 
172  virtual void printPendingOperations() const;
173 
174  virtual void deletePendingOperations();
175 
176  virtual void deletePendingOperationsFor(DtString objectName);
177 
178  virtual void updateObjectIndex();
179 
183  virtual bool objectExistsInIndexByName(const DtString& name,
184  DtString& simAddress, DtString& objectId);
185 
189  virtual bool objectExistsInIndexByGlobalId(const DtString& globalId, DtString& simAddress);
190 
193 
194  static void objectIndexMessageCallback(DtSimMessage* msg, void* usr);
195  virtual void processObjectIndexMessage(DtSimInterfaceMessage* msg);
197 
198 protected:
200  virtual void invokeOrganizationManagerReadyCallbacks();
201 
202  virtual void processAddToOrganization(DtSimMessage* msg);
203  virtual void processRemoveFromOrganization(DtSimMessage* msg);
204 
207  virtual bool setSuperiorIsLocal(const DtEntityIdentifier& subordinateId,
208  const DtEntityIdentifier& superiorId);
209 
212  virtual bool setSuperiorToForceIsLocal(const DtEntityIdentifier& subordinateId);
213 
215  virtual bool detatchFromSuperiorIsLocal(const DtEntityIdentifier& subordinateId);
216 
218  virtual bool setSubordinateOrderIsLocal(const DtEntityIdentifier& superiorId) const;
219 
222  virtual void addOperationToQueue(DtOrgManagerOperation* operation);
223 
226  virtual unsigned int newPendingOperationId();
227 
228  virtual void clearPendingOperationId(unsigned int id);
229 
230  static void pendingOperationCompleteCallback(void* usr);
231 
232  static int nextId();
233 
234 protected:
236  typedef std::pair<DtOrganizationManager*, unsigned int> DtPendingOperationCompletionCallbackData;
237 
240 
243 
244  std::list<unsigned int> myPendingOperationIdList;
246 
248 
251  std::map<DtString, DtNameToObjectIdMap> myReflectedObjectNames;
252 
254  std::map<DtString, DtStringSet> myReflectedObjectGlobalIds;
255 
259 
260  DtPrintPendingOpsCommand* myPrintPendingOpsCommand;
261  DtDeletePendingOpsCommand* myDeletePendingOpsCommand;
262 
263  static int theNextId;
264 
265 };
266 
267 #endif
268 

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)