VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtOrganizationManager Class Reference

This class derives from the DtOrganizationView, and adds the capability to manipulate the hierarchy. More...

Inheritance diagram for DtOrganizationManager:
Inheritance graph
[legend]

Public Types

typedef DtCallbackList< const
DtOrganizationManagerReadyCallbackInfo & > 
DtOrganizationReadyCallbackList
- Public Types inherited from DtOrganizationView
typedef boost::unordered_map
< DtUUID,
DtOrganizationManagerNode * > 
UUIDMap
typedef boost::unordered_map
< int,
DtOrganizationManagerNode * > 
ForceMap

Public Member Functions

 DtOrganizationManager (DtVrfObjectManager *objMgr)
 Constructor.
virtual ~DtOrganizationManager ()
 Destructor.
virtual bool init ()
virtual DtOrganizationManagerNodeaddEntity (DtVrfObject *vrfObject)
 ! Functions for manipulating the hierarchy
virtual void removeEntity (DtVrfObject *vrfObject)
 Overridden to run pending operations after the remove.
virtual void updateAggregate (DtVrfObject *vrfObject)
 Overridden to run pending operations after the update.
virtual void updateEntity (DtVrfObject *vrfObject)
 Overridden to run pending operations after the update.
virtual void setSuperior (const DtUUID &subordinate, const DtUUID &superior, int designator=0, bool localOnly=false)
 Queues operations to add a subordinate to a non-force level superior.
virtual void setSuperiorToForce (const DtUUID &subordinate, int designator=0, bool localOnly=false)
 Queues operations to add a subordinate to it's force level superior.
virtual void queueSetSuperior (const DtUUID &subordinate, const DtUUID &superior, int designator=0, DtOrganizationManagerCallbackFcn completionCallback=0, void *usrData=0)
 Queues an operator to set superior when both the subordinate and the superior exist in the organization hierarchy.
virtual void queueSetSuperiorToForce (const DtUUID &subordinate, int designator=0, DtOrganizationManagerCallbackFcn completionCallback=0, void *usrData=0)
 Queues an operator to set superior to force when both the subordinate and the superior exist in the organization hierarchy.
virtual void queueChangeSet (const DtOrganizationChangeSet &changeSet, int &changeSetRequestId, DtOrganizationManagerCallbackFcn completionCallback=0, void *usrData=0)
 Queues a set of organization change operations specified in changeSet.
virtual void removeChangeSetCallback (int changeSetRequestId, DtOrganizationManagerCallbackFcn completionCallback, void *usrData=0)
virtual void detatchFromSuperior (const DtUUID &subordinate, bool localOnly=false)
 Queues operations to detach a subordinate from its superior.
virtual void setSubordinateOrder (const DtUUID &superior, const std::vector< DtEntityIdentifier > &orderedSubordinateList, bool localOnly=false)
 Set order of subordinates belonging to the given superior, according to the order in the given list.
virtual bool allLocalOrgChangesComplete () const
virtual bool hasPendingOperations () const
 Returns true if there are any pending operations.
virtual void addOrganizationManagerReadyCallback (DtOrganizationManagerReadyCallbackFcn fcn, void *usrData)
 Add callback to be invoked when the organization manager readiness changes.
virtual void removeOrganizationManagerReadyCallback (DtOrganizationManagerReadyCallbackFcn fcn, void *usrData)
 Removes callback to be invoked when the organization manager readiness changes.
virtual void runPendingOperations ()
 Executes all of the pending operations.
virtual void printPendingOperations () const
virtual void deletePendingOperations ()
virtual void deletePendingOperationsFor (DtString objectName)
int numberOfOperations () const
 Number of operations that are pending.
virtual void closingScenario ()
 Called when scenario is closing. Can perform some cleanup.
- Public Member Functions inherited from DtOrganizationView
 DtOrganizationView (DtVrfObjectManager *objMgr)
 Constructor.
virtual ~DtOrganizationView ()
 Destructor.
virtual
DtOrgViewManagedObjectListConstPtr 
getList (const DtUUID &aggregate, const DtVrfObjectPredicate &predicate=DtVrfObjectPredicate::nullPredicate(), bool reevaluateFlag=false, DtTime evaluationPeriod=0.) const
 Request a filtered list of subordinates for a given aggregate, based on user-supplied criteria.
virtual
DtOrgViewManagedObjectListConstPtr 
nullList () const
virtual void objectUUIDChanged (const DtUUID &oldUUID, const DtUUID &newUUID)
 Notification that UUID has changed for the given UUID to the new UUID.
virtual DtOrganizationManagerNodelookupNode (const DtUUID &) const
 Methods for inspecting the hierarchy.
virtual DtOrganizationManagerNodelookupNodeByUUID (const DtUUID &) const
 Looks up node by UUID. Call if you know this is a valid vrfUUID, else call lookupNode.
virtual bool removeNode (const DtUUID &)
 Removes the node represented by the UUID.
virtual bool isSubordinateOfTopLevel (const DtUUID &) const
virtual const DtUUIDsuperior (const DtUUID &) const
virtual DtVrfObjectsuperiorVrfObject (const DtUUID &) const
virtual bool isSubordinateOf (const DtUUID &subordinate, const DtUUID &superior) const
virtual void addNodeAddedCallback (DtUUIDCallbackFunction fcn, void *userData)
 Callback for notification when a child is added to the list of child nodes.
virtual void removeNodeAddedCallback (DtUUIDCallbackFunction fcn, void *userData)
virtual void addNodeRemovedCallback (DtUUIDCallbackFunction fcn, void *userData)
 Callback for notification when a child is to be removed from the list of child nodes.
virtual void removeNodeRemovedCallback (DtUUIDCallbackFunction fcn, void *userData)
virtual void addNodeAboutToBeRemovedCallback (DtUUIDCallbackFunction fcn, void *userData)
 Callback for notification when a child is about to be removed from the list of child nodes.
virtual void removeNodeAboutToBeRemovedCallback (DtUUIDCallbackFunction fcn, void *userData)
virtual DtOrganizationManagerNodelocateSuperiorNodeForGlobalId (const DtGlobalObjectDesignator &globalId) const
 Methods mainly used internally.
virtual bool isLocal (DtOrganizationManagerNode *node) const
virtual void printHierarchy () const
 Prints a text representation of the current hierarchy for debugging.
virtual void printNode (DtOrganizationManagerNode *node, int indentLevel=0) const
 Prints a node and all its children recursively.
virtual DtVrfObjectManagerobjectManager ()
virtual DtSharedVrfObjectReference topLevelObjectForForce (const DtForceType &force)
virtual DtOrganizationManagerNodetopLevelNodeForForce (DtForceType force)
virtual const UUIDMapnodes () const

Static Public Member Functions

static void addToOrganizationCallback (DtSimMessage *msg, void *usr)
static void removeFromOrganizationCallback (DtSimMessage *msg, void *usr)
- Static Public Member Functions inherited from DtOrganizationView
static void vrfObjectAddedCallback (DtVrfObject *vrfObject, void *usr)
static void vrfObjectAboutToBeRemovedCallback (DtVrfObject *vrfObject, void *usr)
static bool isTopLevelEntity (const DtEntityType &objectType)
static bool isOrganizedAggregate (DtVrfObject *vrfObject)
static bool isOrganizedEntity (DtVrfObject *vrfObject)

Protected Types

typedef std::pair
< DtOrganizationManager
*, unsigned int
DtPendingOperationCompletionCallbackData
 Structure used in the userData field of the pending operation callbacks.
- Protected Types inherited from DtOrganizationView
typedef std::list
< DtUUIDCallbackInfo
DtUUIDCallbackInfoList

Protected Member Functions

virtual void invokeOrganizationManagerReadyCallbacks ()
 Called when organization manager ready state has changed.
virtual void processAddToOrganization (DtSimMessage *msg)
virtual void processRemoveFromOrganization (DtSimMessage *msg)
virtual bool setSuperiorIsLocal (const DtUUID &subordinate, const DtUUID &superiorId)
 Returns true if the entire equivalent setSuperior call can be completed locally.
virtual bool setSuperiorToForceIsLocal (const DtUUID &subordinate)
 Returns true if the entire equivalent setSuperiorToForce can be completed locally.
virtual bool detatchFromSuperiorIsLocal (const DtUUID &subordinate)
 Returns true if the entire equivalent detach call can be completed locally.
virtual bool setSubordinateOrderIsLocal (const DtUUID &superior) const
 Returns true if setSubordinateOrder call can be completed locally.
virtual void addOperationToQueue (DtOrgManagerOperation *operation)
 Adds the specified operation to the queue.
virtual unsigned int newPendingOperationId ()
 Inserts the next pending operation ID onto the pending list, and returns that same ID.
virtual void clearPendingOperationId (unsigned int id)
- Protected Member Functions inherited from DtOrganizationView
 DtOrganizationView (const DtOrganizationView &orig)
 Copy constructor not implemented.
DtOrganizationViewoperator= (const DtOrganizationView &orig)
 Assignment operator not implemented.
virtual DtOrganizationManagerNodecreateOrganizationManagerNode () const
 Creates a new node to put into the hierarchy.
virtual void processVrfObjectAdded (DtVrfObject *vrfObject)
virtual void processVrfObjectAboutToBeRemoved (DtVrfObject *vrfObject)
 Looks up vrfObject's superior.
virtual bool shouldBeAdded (DtVrfObject *vrfObject) const
virtual void findAndConnectNodeParent (DtOrganizationManagerNode *node)
 Searches the existing hierarchy for an aggregate which claims this node, and connects it as a child.
virtual void disconnectNodeParent (DtOrganizationManagerNode *node)
 Removes the specified node from the child list of it's current parent, and sets it parent to NULL.
virtual void findAndConnectNodeChildren (DtOrganizationManagerNode *node)
 Looks up this vrfObject, and searches the existing hierarchy for any nodes specified in the subordinate manger of this object and connects them to this node as children.
virtual void disconnectNodeChildren (DtOrganizationManagerNode *node)
 Disconnects all the children from this node.
virtual void connectNodeToTopLevel (DtOrganizationManagerNode *node, bool allowCreation=true)
 Makes this node a child of the top level node corresponding to its force type.
virtual bool networkStateIsDifferentFromLocalState (const DtOrganizationManagerNode &node) const
virtual void invokeNodeAddedCallbacks (const DtUUID &) const
 Invokes all callbacks registered for notification that a node has been added.
virtual void invokeNodeRemovedCallbacks (const DtUUID &) const
 Invokes all callbacks registered for notification that a node is removed.
virtual void invokeNodeAboutToBeRemovedCallbacks (const DtUUID &) const
 Invokes all callbacks registered for notification that a node is about to be removed.

Static Protected Member Functions

static void pendingOperationCompleteCallback (void *usr)
static int nextId ()

Protected Attributes

DtList myPendingOperationList
 List of DtOrgManagerOperations which have not been successfully executed yet.
bool myOperationsRunning
 Flag to prevent reentrance of runPendingOperations.
std::list< unsigned intmyPendingOperationIdList
unsigned int myNextPendingOperationId
DtOrganizationReadyCallbackList myOrganizationManagerReadyCallbackList
DtPrintPendingOpsCommand * myPrintPendingOpsCommand
DtDeletePendingOpsCommand * myDeletePendingOpsCommand
- Protected Attributes inherited from DtOrganizationView
DtVrfObjectManagermyObjectManager
ForceMap myTopLevelNodes
 Hash list of top level nodes hashed by force type.
UUIDMap myIdHashList
 Hash list associating entity identifiers with nodes.
DtUUIDCallbackInfoList myNodeAddedCallbackList
DtUUIDCallbackInfoList myNodeRemovedCallbackList
DtUUIDCallbackInfoList myNodeAboutToBeRemovedCallbackList
DtOrgViewManagedObjectListManagermyManagedObjectListManager

Static Protected Attributes

static int theNextId

Private Member Functions

 DtOrganizationManager ()
 Default constructor not implemented.
 DtOrganizationManager (const DtOrganizationManager &orig)
 Copy constructor not implemented.
DtOrganizationManageroperator= (const DtOrganizationManager &orig)
 Assignment operator not implemented.

Detailed Description

This class derives from the DtOrganizationView, and adds the capability to manipulate the hierarchy.

Remember that the organization view is solely based off of what is heard over the network, and the manipulation that occurs on the org manager level changes the subordinate lists of local entites (and remotes by sending messages to the org manager on the backend simulating them). Because of this, changes made to the organization hierarchy through these calls will not be seen immediately in the organization view.

Examples

Member Typedef Documentation

Structure used in the userData field of the pending operation callbacks.

Constructor & Destructor Documentation

DtOrganizationManager::DtOrganizationManager ( )
private

Default constructor not implemented.

DtOrganizationManager::DtOrganizationManager ( const DtOrganizationManager orig)
private

Copy constructor not implemented.

DtOrganizationManager::DtOrganizationManager ( DtVrfObjectManager objMgr)

Constructor.

virtual DtOrganizationManager::~DtOrganizationManager ( )
virtual

Destructor.

Member Function Documentation

DtOrganizationManager& DtOrganizationManager::operator= ( const DtOrganizationManager orig)
private

Assignment operator not implemented.

virtual bool DtOrganizationManager::init ( )
virtual

Reimplemented from DtOrganizationView.

virtual DtOrganizationManagerNode* DtOrganizationManager::addEntity ( DtVrfObject vrfObject)
virtual

! Functions for manipulating the hierarchy

Overridden to run pending operations after the add.

Reimplemented from DtOrganizationView.

virtual void DtOrganizationManager::removeEntity ( DtVrfObject vrfObject)
virtual

Overridden to run pending operations after the remove.

Reimplemented from DtOrganizationView.

virtual void DtOrganizationManager::updateAggregate ( DtVrfObject vrfObject)
virtual

Overridden to run pending operations after the update.

Reimplemented from DtOrganizationView.

virtual void DtOrganizationManager::updateEntity ( DtVrfObject vrfObject)
virtual

Overridden to run pending operations after the update.

Reimplemented from DtOrganizationView.

virtual void DtOrganizationManager::setSuperior ( const DtUUID subordinate,
const DtUUID superior,
int  designator = 0,
bool  localOnly = false 
)
virtual

Queues operations to add a subordinate to a non-force level superior.

An implicit detach is included in this call. if localOnly is false, a message will be sent to all backends if the operation cannot be complete locally.

virtual void DtOrganizationManager::setSuperiorToForce ( const DtUUID subordinate,
int  designator = 0,
bool  localOnly = false 
)
virtual

Queues operations to add a subordinate to it's force level superior.

An implicit detach is included in this call. If localOnly is false, a message will be sent to all backends if the operation cannot be completed locally.

virtual void DtOrganizationManager::queueSetSuperior ( const DtUUID subordinate,
const DtUUID superior,
int  designator = 0,
DtOrganizationManagerCallbackFcn  completionCallback = 0,
void *  usrData = 0 
)
virtual

Queues an operator to set superior when both the subordinate and the superior exist in the organization hierarchy.

If necessary, messages will be sent to other backends to complete the operation once the objects exist. Optionally takes a completion callback function pointer and user data as an argument. This callback will be invoked onces the setSuperior operation has successfully completed.

virtual void DtOrganizationManager::queueSetSuperiorToForce ( const DtUUID subordinate,
int  designator = 0,
DtOrganizationManagerCallbackFcn  completionCallback = 0,
void *  usrData = 0 
)
virtual

Queues an operator to set superior to force when both the subordinate and the superior exist in the organization hierarchy.

If necessary, messages will be sent to other backends to complete the operation once the objects exist. Optionally takes a completion callback function pointer and user data as an argument. This callback will be invoked onces the setSuperior operation has successfully completed.

virtual void DtOrganizationManager::queueChangeSet ( const DtOrganizationChangeSet changeSet,
int changeSetRequestId,
DtOrganizationManagerCallbackFcn  completionCallback = 0,
void *  usrData = 0 
)
virtual

Queues a set of organization change operations specified in changeSet.

Optionally takes a completion callback function pointer and user data as an argument. This callback will be invoked onces the entire change set has successfully completed.

virtual void DtOrganizationManager::removeChangeSetCallback ( int  changeSetRequestId,
DtOrganizationManagerCallbackFcn  completionCallback,
void *  usrData = 0 
)
virtual
virtual void DtOrganizationManager::detatchFromSuperior ( const DtUUID subordinate,
bool  localOnly = false 
)
virtual

Queues operations to detach a subordinate from its superior.

if localOnly is false, a message will be sent to other backends if the operation cannot be completed locally.

virtual void DtOrganizationManager::setSubordinateOrder ( const DtUUID superior,
const std::vector< DtEntityIdentifier > &  orderedSubordinateList,
bool  localOnly = false 
)
virtual

Set order of subordinates belonging to the given superior, according to the order in the given list.

static void DtOrganizationManager::addToOrganizationCallback ( DtSimMessage msg,
void *  usr 
)
static
static void DtOrganizationManager::removeFromOrganizationCallback ( DtSimMessage msg,
void *  usr 
)
static
virtual bool DtOrganizationManager::allLocalOrgChangesComplete ( ) const
virtual
Returns
True if all locally initiated organization changes have been carried out. This applies to any operations initiated with queueSetSuperior() or queueSetSuperiorToForce().
virtual bool DtOrganizationManager::hasPendingOperations ( ) const
virtual

Returns true if there are any pending operations.

virtual void DtOrganizationManager::addOrganizationManagerReadyCallback ( DtOrganizationManagerReadyCallbackFcn  fcn,
void *  usrData 
)
virtual

Add callback to be invoked when the organization manager readiness changes.

virtual void DtOrganizationManager::removeOrganizationManagerReadyCallback ( DtOrganizationManagerReadyCallbackFcn  fcn,
void *  usrData 
)
virtual

Removes callback to be invoked when the organization manager readiness changes.

virtual void DtOrganizationManager::runPendingOperations ( )
virtual

Executes all of the pending operations.

virtual void DtOrganizationManager::printPendingOperations ( ) const
virtual
virtual void DtOrganizationManager::deletePendingOperations ( )
virtual
virtual void DtOrganizationManager::deletePendingOperationsFor ( DtString  objectName)
virtual
int DtOrganizationManager::numberOfOperations ( ) const
inline

Number of operations that are pending.

virtual void DtOrganizationManager::closingScenario ( )
virtual

Called when scenario is closing. Can perform some cleanup.

virtual void DtOrganizationManager::invokeOrganizationManagerReadyCallbacks ( )
protectedvirtual

Called when organization manager ready state has changed.

virtual void DtOrganizationManager::processAddToOrganization ( DtSimMessage msg)
protectedvirtual
virtual void DtOrganizationManager::processRemoveFromOrganization ( DtSimMessage msg)
protectedvirtual
virtual bool DtOrganizationManager::setSuperiorIsLocal ( const DtUUID subordinate,
const DtUUID superiorId 
)
protectedvirtual

Returns true if the entire equivalent setSuperior call can be completed locally.

virtual bool DtOrganizationManager::setSuperiorToForceIsLocal ( const DtUUID subordinate)
protectedvirtual

Returns true if the entire equivalent setSuperiorToForce can be completed locally.

virtual bool DtOrganizationManager::detatchFromSuperiorIsLocal ( const DtUUID subordinate)
protectedvirtual

Returns true if the entire equivalent detach call can be completed locally.

virtual bool DtOrganizationManager::setSubordinateOrderIsLocal ( const DtUUID superior) const
protectedvirtual

Returns true if setSubordinateOrder call can be completed locally.

virtual void DtOrganizationManager::addOperationToQueue ( DtOrgManagerOperation operation)
protectedvirtual

Adds the specified operation to the queue.

The queue will delete this object when it is done with it. Please don't keep a pointer to it.

virtual unsigned int DtOrganizationManager::newPendingOperationId ( )
protectedvirtual

Inserts the next pending operation ID onto the pending list, and returns that same ID.

virtual void DtOrganizationManager::clearPendingOperationId ( unsigned int  id)
protectedvirtual
static void DtOrganizationManager::pendingOperationCompleteCallback ( void *  usr)
staticprotected
static int DtOrganizationManager::nextId ( )
staticprotected

Member Data Documentation

DtList DtOrganizationManager::myPendingOperationList
protected

List of DtOrgManagerOperations which have not been successfully executed yet.

bool DtOrganizationManager::myOperationsRunning
protected

Flag to prevent reentrance of runPendingOperations.

std::list<unsigned int> DtOrganizationManager::myPendingOperationIdList
protected
unsigned int DtOrganizationManager::myNextPendingOperationId
protected
DtOrganizationReadyCallbackList DtOrganizationManager::myOrganizationManagerReadyCallbackList
protected
DtPrintPendingOpsCommand* DtOrganizationManager::myPrintPendingOpsCommand
protected
DtDeletePendingOpsCommand* DtOrganizationManager::myDeletePendingOpsCommand
protected
int DtOrganizationManager::theNextId
staticprotected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)