VR-Forces 4.2 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 
50 {
51 private:
58 
59 public:
61 
62 public:
63 
67  virtual ~DtOrganizationManager();
68 
69  virtual bool init();
70 
74 
76  virtual DtOrganizationManagerNode* addEntity(DtVrfObject *vrfObject);
77 
79  virtual void removeEntity(DtVrfObject *vrfObject);
80 
82  virtual void updateAggregate(DtVrfObject *vrfObject);
83 
85  virtual void updateEntity(DtVrfObject *vrfObject);
86 
91  virtual void setSuperior(const DtEntityIdentifier& subordinateId,
92  const DtEntityIdentifier& superiorId, int designator = 0,
93  bool localOnly = false);
94 
99  virtual void setSuperiorToForce(const DtEntityIdentifier& subordinateId,
100  int designator = 0, bool localOnly = false);
101 
109  virtual void queueSetSuperior(const DtString& subordinateName,
110  const DtString& superiorName, int designator = 0,
111  DtOrganizationManagerCallbackFcn completionCallback = 0, void* usrData = 0);
112 
120  virtual void queueSetSuperiorToForce(const DtString& subordinateName,
121  int designator = 0, DtOrganizationManagerCallbackFcn completionCallback = 0, void* usrData = 0);
122 
127  virtual void queueChangeSet(const DtOrganizationChangeSet& changeSet, int& changeSetRequestId,
128  DtOrganizationManagerCallbackFcn completionCallback = 0, void* usrData = 0);
129 
130  virtual void removeChangeSetCallback(int changeSetRequestId,
131  DtOrganizationManagerCallbackFcn completionCallback, void* usrData = 0);
132 
136  virtual void detatchFromSuperior(const DtEntityIdentifier& subordinateId,
137  bool localOnly = false);
138 
141  virtual void setSubordinateOrder(const DtEntityIdentifier& superiorId,
142  const std::vector<DtEntityIdentifier>& orderedSubordinateList,
143  bool localOnly = false);
144 
145  static void addToOrganizationCallback(DtSimMessage* msg, void* usr);
146  static void removeFromOrganizationCallback(DtSimMessage* msg, void* usr);
147 
151  static void objectAboutToBeRemovedCallback(DtVrfObject* vrfObject,
152  void* usr);
153  virtual void processObjectAboutToBeRemoved();
154 
158  virtual bool allLocalOrgChangesComplete() const;
159 
161  virtual bool hasPendingOperations() const;
162 
164  virtual void addOrganizationManagerReadyCallback(
165  DtOrganizationManagerReadyCallbackFcn fcn, void* usrData);
166 
168  virtual void removeOrganizationManagerReadyCallback(
169  DtOrganizationManagerReadyCallbackFcn fcn, void* usrData);
170 
172  virtual void runPendingOperations();
173 
174  virtual void printPendingOperations() const;
175 
176  virtual void deletePendingOperations();
177 
178  virtual void deletePendingOperationsFor(DtString objectName);
179 
180  virtual void updateObjectIndex();
181 
185  virtual bool objectExistsInIndexByName(const DtString& name,
186  DtString& simAddress, DtString& objectId);
187 
191  virtual bool objectExistsInIndexByGlobalId(const DtString& globalId, DtString& simAddress);
192 
195 
196  static void objectIndexMessageCallback(DtSimMessage* msg, void* usr);
197  virtual void processObjectIndexMessage(DtSimInterfaceMessage* msg);
199 
200 protected:
202  virtual void invokeOrganizationManagerReadyCallbacks();
203 
204  virtual void processAddToOrganization(DtSimMessage* msg);
205  virtual void processRemoveFromOrganization(DtSimMessage* msg);
206 
209  virtual bool setSuperiorIsLocal(const DtEntityIdentifier& subordinateId,
210  const DtEntityIdentifier& superiorId);
211 
214  virtual bool setSuperiorToForceIsLocal(const DtEntityIdentifier& subordinateId);
215 
217  virtual bool detatchFromSuperiorIsLocal(const DtEntityIdentifier& subordinateId);
218 
220  virtual bool setSubordinateOrderIsLocal(const DtEntityIdentifier& superiorId) const;
221 
224  virtual void addOperationToQueue(DtOrgManagerOperation* operation);
225 
228  virtual unsigned int newPendingOperationId();
229 
230  virtual void clearPendingOperationId(unsigned int id);
231 
232  static void pendingOperationCompleteCallback(void* usr);
233 
234  static int nextId();
235 
236 protected:
238  typedef std::pair<DtOrganizationManager*, unsigned int> DtPendingOperationCompletionCallbackData;
239 
242 
245 
246  std::list<unsigned int> myPendingOperationIdList;
248 
250 
253  std::map<DtString, DtNameToObjectIdMap> myReflectedObjectNames;
254 
256  std::map<DtString, DtStringSet> myReflectedObjectGlobalIds;
257 
261 
262  DtPrintPendingOpsCommand* myPrintPendingOpsCommand;
263  DtDeletePendingOpsCommand* myDeletePendingOpsCommand;
264 
265  static int theNextId;
266 
267 };
268 
269 #endif
270 

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)