VR-Forces 4.7 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 | 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]

Public Types

typedef boost::unordered_map
< DtUUID,
DtOrganizationManagerNode * > 
UUIDMap
typedef boost::unordered_map
< int,
DtOrganizationManagerNode * > 
ForceMap

Public Member Functions

 DtOrganizationView (DtVrfObjectManager *objMgr)
 Constructor.
virtual ~DtOrganizationView ()
 Destructor.
virtual bool init ()
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 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 (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)

Static Public Member Functions

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

Protected Types

typedef std::list
< DtUUIDCallbackInfo
DtUUIDCallbackInfoList

Protected Member Functions

 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.
virtual DtOrganizationManagerNodefindNode (DtVrfObject *obj) const
 Try and find the org manager node by uuid, entity identifier and then marking text.
virtual DtVrfObjectfindObject (const DtUUID &uuid) const
 Try to find object by UUID.

Protected Attributes

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
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 bool isTopLevelEntity (const DtEntityType &objectType)
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

DtOrganizationView::DtOrganizationView ( const DtOrganizationView orig)
protected

Copy constructor not implemented.

DtOrganizationView::DtOrganizationView ( DtVrfObjectManager objMgr)

Constructor.

Parameters
objMgrThe object manager that maintains the list of all entities and objects in the simulation.
virtual DtOrganizationView::~DtOrganizationView ( )
virtual

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 DtUUID ) const
virtual

Methods for inspecting the hierarchy.

virtual DtOrganizationManagerNode* DtOrganizationView::lookupNodeByUUID ( const DtUUID ) const
virtual

Looks up node by UUID. Call if you know this is a valid vrfUUID, else call lookupNode.

virtual bool DtOrganizationView::removeNode ( const DtUUID )
virtual

Removes the node represented by the UUID.

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

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 DtUUID aggregate,
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 DtOrgViewManagedObjectListConstPtr DtOrganizationView::nullList ( ) const
virtual
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.

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

Prints a node and all its children recursively.

virtual DtVrfObjectManager* DtOrganizationView::objectManager ( )
virtual
virtual DtSharedVrfObjectReference 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.
virtual const UUIDMap& DtOrganizationView::nodes ( ) const
virtual
Returns
Hash list of nodes by entity id
static bool DtOrganizationView::isTopLevelEntity ( const DtEntityType &  objectType)
static
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 ( DtUUIDCallbackFunction  fcn,
void *  userData 
)
virtual

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

virtual void DtOrganizationView::removeNodeAddedCallback ( DtUUIDCallbackFunction  fcn,
void *  userData 
)
virtual
virtual void DtOrganizationView::addNodeRemovedCallback ( DtUUIDCallbackFunction  fcn,
void *  userData 
)
virtual

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

This is called after it has been disconnected from parent nodes

virtual void DtOrganizationView::removeNodeRemovedCallback ( DtUUIDCallbackFunction  fcn,
void *  userData 
)
virtual
virtual void DtOrganizationView::addNodeAboutToBeRemovedCallback ( DtUUIDCallbackFunction  fcn,
void *  userData 
)
virtual

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

This is called before it has been disconnected from parent nodes

virtual void DtOrganizationView::removeNodeAboutToBeRemovedCallback ( DtUUIDCallbackFunction  fcn,
void *  userData 
)
virtual
virtual void DtOrganizationView::objectUUIDChanged ( const DtUUID oldUUID,
const DtUUID newUUID 
)
virtual

Notification that UUID has changed for the given UUID to the new UUID.

Should only be called for remote objects that are not published by vr-forces

virtual DtOrganizationManagerNode* DtOrganizationView::createOrganizationManagerNode ( ) const
protectedvirtual

Creates a new node to put into the hierarchy.

virtual void DtOrganizationView::processVrfObjectAdded ( DtVrfObject vrfObject)
protectedvirtual
virtual void DtOrganizationView::processVrfObjectAboutToBeRemoved ( DtVrfObject vrfObject)
protectedvirtual

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
protectedvirtual
Returns
true if this object should be added to the hierarchy.
virtual void DtOrganizationView::findAndConnectNodeParent ( DtOrganizationManagerNode node)
protectedvirtual

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

virtual void DtOrganizationView::disconnectNodeParent ( DtOrganizationManagerNode node)
protectedvirtual

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)
protectedvirtual

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)
protectedvirtual

Disconnects all the children from this node.

virtual void DtOrganizationView::connectNodeToTopLevel ( DtOrganizationManagerNode node,
bool  allowCreation = true 
)
protectedvirtual

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 bool DtOrganizationView::networkStateIsDifferentFromLocalState ( const DtOrganizationManagerNode node) const
protectedvirtual
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 DtUUID ) const
protectedvirtual

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

virtual void DtOrganizationView::invokeNodeRemovedCallbacks ( const DtUUID ) const
protectedvirtual

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

This is called after it has been disconnected from parent nodes

virtual void DtOrganizationView::invokeNodeAboutToBeRemovedCallbacks ( const DtUUID ) const
protectedvirtual

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

This is called before it is disconnected from parent nodes

virtual DtOrganizationManagerNode* DtOrganizationView::findNode ( DtVrfObject obj) const
protectedvirtual

Try and find the org manager node by uuid, entity identifier and then marking text.

virtual DtVrfObject* DtOrganizationView::findObject ( const DtUUID uuid) const
protectedvirtual

Try to find object by UUID.

Member Data Documentation

DtVrfObjectManager* DtOrganizationView::myObjectManager
protected
ForceMap DtOrganizationView::myTopLevelNodes
protected

Hash list of top level nodes hashed by force type.

UUIDMap DtOrganizationView::myIdHashList
protected

Hash list associating entity identifiers with nodes.

DtUUIDCallbackInfoList DtOrganizationView::myNodeAddedCallbackList
protected
DtUUIDCallbackInfoList DtOrganizationView::myNodeRemovedCallbackList
protected
DtUUIDCallbackInfoList DtOrganizationView::myNodeAboutToBeRemovedCallbackList
protected
DtOrgViewManagedObjectListManager* DtOrganizationView::myManagedObjectListManager
protected

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

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)