VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
DtOrganizationView Class Reference

This class maintains a hierarchy of the existing organized entities for a simulation based on the contents of Aggregate State PDUs. More...

Inheritance diagram for DtOrganizationView:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtOrganizationView (DtVrfObjectManager *objMgr)
 Constructor.
virtual ~DtOrganizationView ()
 Destructor.
virtual bool init ()
virtual
DtOrgViewManagedObjectListConstPtr 
getList (const DtEntityIdentifier &aggregateId, 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 DtOrganizationManagerNodelookupNode (const DtEntityIdentifier &id) const
 Methods for inspecting the hierarchy.
virtual bool isSubordinateOfTopLevel (const DtEntityIdentifier &id) const
virtual const DtEntityIdentifier & superior (const DtEntityIdentifier &id) const
virtual DtVrfObjectsuperiorVrfObject (const DtEntityIdentifier &id) const
virtual bool isSubordinateOf (const DtEntityIdentifier &subordinateId, const DtEntityIdentifier &superiorId) const
virtual DtOrganizationManagerNodeaddEntity (DtVrfObject *vrfObject)
 Functions for manipulating the hierarchy.
virtual void removeEntity (DtVrfObject *vrfObject)
 Removes the node for this entity from the hierarchy.
virtual void updateAggregate (DtVrfObject *vrfObject)
 Updates the connections to the node corresponding to this aggregate.
virtual void updateEntity (DtVrfObject *vrfObject)
 Updates the connections to the node corresponding to this entity.
virtual void addNodeAddedCallback (DtEntityIdentifierCallbackFunction fcn, void *userData)
 Callback for notification when a child is added to the list of child nodes.
virtual void removeNodeAddedCallback (DtEntityIdentifierCallbackFunction fcn, void *userData)
 Callback for notification when a child is added to the list of child nodes.
virtual void addNodeRemovedCallback (DtEntityIdentifierCallbackFunction fcn, void *userData)
 Callback for notification when a child is about to be removed from the list of child nodes.
virtual void removeNodeRemovedCallback (DtEntityIdentifierCallbackFunction fcn, void *userData)
 Callback for notification when a child is about to be removed from the list of child nodes.

Static Public Member Functions

static void vrfObjectAddedCallback (DtVrfObject *vrfObject, void *usr)
static void vrfObjectAboutToBeRemovedCallback (DtVrfObject *vrfObject, void *usr)

Protected Types

typedef std::list
< DtEntityIdentifierCallbackInfo
DtEntityIdentifierCallbackInfoList

Protected Member Functions

 DtOrganizationView (const DtOrganizationView &orig)
 Copy constructor not implemented.
DtOrganizationViewoperator= (const DtOrganizationView &orig)
 Assignment operator not implemented.
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 void printNode (DtOrganizationManagerNode *node, int indentLevel=0) const
 Prints a node and all it's children recursively.
virtual bool networkStateIsDifferentFromLocalState (const DtOrganizationManagerNode &node) const
virtual void invokeNodeAddedCallbacks (const DtEntityIdentifier &entId) const
 Invokes all callbacks registered for notification that a node has been added.
virtual void invokeNodeRemovedCallbacks (const DtEntityIdentifier &entId) const
 Invokes all callbacks registered for notification that a node is about to be removed.

Protected Attributes

DtVrfObjectManagermyObjectManager
DtHashList myTopLevelNodes
 Hash list of top level nodes hashed by force type. (.
DtHashList myIdHashList
 Hash list associating entity identifiers with nodes.
DtEntityIdentifierCallbackInfoList myNodeAddedCallbackList
DtEntityIdentifierCallbackInfoList myNodeRemovedCallbackList
DtOrgViewManagedObjectListManagermyManagedObjectListManager
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 DtVrfObjectManagerobjectManager ()
 Methods mainly used internally.
virtual DtVrfObjecttopLevelObjectForForce (const DtForceType &force)
virtual DtOrganizationManagerNodetopLevelNodeForForce (DtForceType force)
static bool isTopLevelEntity (const DtEntityType &objectType)
 Methods mainly used internally.
static bool isOrganizedAggregate (DtVrfObject *vrfObject)
static bool isOrganizedEntity (DtVrfObject *vrfObject)

Detailed Description

This class maintains a hierarchy of the existing organized entities for a simulation based on the contents of Aggregate State PDUs.

It is the central point for making inquiries about the organization of entities in the simulation.


Member Typedef Documentation


Constructor & Destructor Documentation

Copy constructor not implemented.

Constructor.

Parameters:
objMgrThe object manager that maintains the list of all entities and objects in the simulation.

Destructor.


Member Function Documentation

DtOrganizationView& DtOrganizationView::operator= ( const DtOrganizationView orig) [protected]

Assignment operator not implemented.

virtual bool DtOrganizationView::init ( ) [virtual]

Reimplemented in DtOrganizationManager.

virtual DtOrganizationManagerNode* DtOrganizationView::lookupNode ( const DtEntityIdentifier &  id) const [virtual]

Methods for inspecting the hierarchy.

virtual bool DtOrganizationView::isSubordinateOfTopLevel ( const DtEntityIdentifier &  id) const [virtual]
Returns:
true if the specified entity is a direct subordinate of a force level aggregate.
virtual const DtEntityIdentifier& DtOrganizationView::superior ( const DtEntityIdentifier &  id) const [virtual]
Returns:
the ID of this entitie's superior.
virtual DtVrfObject* DtOrganizationView::superiorVrfObject ( const DtEntityIdentifier &  id) const [virtual]
Returns:
a pointer to the superior of an entity.
virtual bool DtOrganizationView::isSubordinateOf ( const DtEntityIdentifier &  subordinateId,
const DtEntityIdentifier &  superiorId 
) const [virtual]
Returns:
true if <subordinate> is a direct subordinate of <superior>.

Functions for manipulating the hierarchy.

Creates and adds a new node for this entity.

Reimplemented in DtOrganizationManager.

virtual void DtOrganizationView::removeEntity ( DtVrfObject vrfObject) [virtual]

Removes the node for this entity from the hierarchy.

Reimplemented in DtOrganizationManager.

virtual void DtOrganizationView::updateAggregate ( DtVrfObject vrfObject) [virtual]

Updates the connections to the node corresponding to this aggregate.

Reimplemented in DtOrganizationManager.

virtual void DtOrganizationView::updateEntity ( DtVrfObject vrfObject) [virtual]

Updates the connections to the node corresponding to this entity.

Reimplemented in DtOrganizationManager.

virtual DtOrgViewManagedObjectListConstPtr DtOrganizationView::getList ( const DtEntityIdentifier &  aggregateId,
const DtVrfObjectPredicate predicate = DtVrfObjectPredicate::nullPredicate(),
bool  reevaluateFlag = false,
DtTime  evaluationPeriod = 0. 
) const [virtual]

Request a filtered list of subordinates for a given aggregate, based on user-supplied criteria.

The list returned is a shared pointer, and may be used by other requesters of the same list. The list will be released when all references go out of scope.

Note:
Maintaining filtered lists may be computationally expensive.
virtual DtOrganizationManagerNode* DtOrganizationView::locateSuperiorNodeForGlobalId ( const DtGlobalObjectDesignator &  globalId) const [virtual]

Methods mainly used internally.

Searches the current nodes for an aggregate which is claiming the specified global ID as it's subordinate, and returns that node.

virtual bool DtOrganizationView::isLocal ( DtOrganizationManagerNode node) const [virtual]
Returns:
true if the object referred to be this node is locally simulated.
virtual void DtOrganizationView::printHierarchy ( ) const [virtual]

Prints a text representation of the current hierarchy for debugging.

Methods mainly used internally.

Searches the current nodes for an aggregate which is claiming the specified global ID as it's subordinate, and returns that node.

virtual DtVrfObject* DtOrganizationView::topLevelObjectForForce ( const DtForceType &  force) [virtual]
Returns:
the top level vrfObject (always local) for the specified force. Calls topLevelNodeForForce and looks up the object.
virtual DtOrganizationManagerNode* DtOrganizationView::topLevelNodeForForce ( DtForceType  force) [virtual]
Returns:
the top level node (always local) for the specified force.
static bool DtOrganizationView::isTopLevelEntity ( const DtEntityType &  objectType) [static]

Methods mainly used internally.

Searches the current nodes for an aggregate which is claiming the specified global ID as it's subordinate, and returns that node.

static bool DtOrganizationView::isOrganizedAggregate ( DtVrfObject vrfObject) [static]
Returns:
true if this object is a type which corresponds to a type that should be a potentially non-leaf node in the org hierarchy.
static bool DtOrganizationView::isOrganizedEntity ( DtVrfObject vrfObject) [static]
Returns:
true if this object is a type which corresponds to a type that should be a leaf node in the org hierarchy.
static void DtOrganizationView::vrfObjectAddedCallback ( DtVrfObject vrfObject,
void *  usr 
) [static]
static void DtOrganizationView::vrfObjectAboutToBeRemovedCallback ( DtVrfObject vrfObject,
void *  usr 
) [static]
virtual void DtOrganizationView::addNodeAddedCallback ( DtEntityIdentifierCallbackFunction  fcn,
void *  userData 
) [virtual]

Callback for notification when a child is added to the list of child nodes.

virtual void DtOrganizationView::removeNodeAddedCallback ( DtEntityIdentifierCallbackFunction  fcn,
void *  userData 
) [virtual]

Callback for notification when a child is added to the list of child nodes.

virtual void DtOrganizationView::addNodeRemovedCallback ( DtEntityIdentifierCallbackFunction  fcn,
void *  userData 
) [virtual]

Callback for notification when a child is about to be removed from the list of child nodes.

virtual void DtOrganizationView::removeNodeRemovedCallback ( DtEntityIdentifierCallbackFunction  fcn,
void *  userData 
) [virtual]

Callback for notification when a child is about to be removed from the list of child nodes.

virtual void DtOrganizationView::processVrfObjectAdded ( DtVrfObject vrfObject) [protected, virtual]
virtual void DtOrganizationView::processVrfObjectAboutToBeRemoved ( DtVrfObject vrfObject) [protected, virtual]

Looks up vrfObject's superior.

If it exists, removes vrfObject from superior's subordinate manager. Then calls removeEntity().

virtual bool DtOrganizationView::shouldBeAdded ( DtVrfObject vrfObject) const [protected, virtual]
Returns:
true if this object should be added to the hierarchy.
virtual void DtOrganizationView::findAndConnectNodeParent ( DtOrganizationManagerNode node) [protected, virtual]

Searches the existing hierarchy for an aggregate which claims this node, and connects it as a child.

virtual void DtOrganizationView::disconnectNodeParent ( DtOrganizationManagerNode node) [protected, virtual]

Removes the specified node from the child list of it's current parent, and sets it parent to NULL.

virtual void DtOrganizationView::findAndConnectNodeChildren ( DtOrganizationManagerNode node) [protected, virtual]

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 DtOrganizationView::disconnectNodeChildren ( DtOrganizationManagerNode node) [protected, virtual]

Disconnects all the children from this node.

virtual void DtOrganizationView::connectNodeToTopLevel ( DtOrganizationManagerNode node,
bool  allowCreation = true 
) [protected, virtual]

Makes this node a child of the top level node corresponding to its force type.

If allowCreation is true, this function will create the appropriate top level entity if it doesn't already exist.

virtual void DtOrganizationView::printNode ( DtOrganizationManagerNode node,
int  indentLevel = 0 
) const [protected, virtual]

Prints a node and all it's children recursively.

Returns:
true if ordered list of subordinates in the network state (the VR-Link state repository) is different than the ordered list of subordinates in the given node.
virtual void DtOrganizationView::invokeNodeAddedCallbacks ( const DtEntityIdentifier &  entId) const [protected, virtual]

Invokes all callbacks registered for notification that a node has been added.

virtual void DtOrganizationView::invokeNodeRemovedCallbacks ( const DtEntityIdentifier &  entId) const [protected, virtual]

Invokes all callbacks registered for notification that a node is about to be removed.


Member Data Documentation

DtHashList DtOrganizationView::myTopLevelNodes [protected]

Hash list of top level nodes hashed by force type. (.

DtHashList DtOrganizationView::myIdHashList [protected]

Hash list associating entity identifiers with nodes.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)