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 | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
DtOrbatManager Class Reference

This class derives from the DtOrganizationManager and will handle all requests as it pertains to the orbat. More...

Public Types

typedef boost::unordered_map
< DtUUID, DtOrbatManagerNode * > 
UUIDMap

Public Member Functions

 DtOrbatManager (DtVrfObjectManager *objMgr)
 Constructor.
virtual ~DtOrbatManager ()
 Destructor.
virtual bool init ()
virtual void closingScenario ()
 Called when scenario is closing. Can perform some cleanup.
virtual void setOrbatEnabled (bool)
 Sets whether or not this is enabled to process orbat messages. Default is false.
virtual bool orbatEnabled () const
virtual DtOrbatDataList addOrUpdateObjectsInOrbat (const DtOrbatDataList &, int flags=DtIfOrbatOperation::IterateChildrenOnAdd)
 Adds the specified orbat items to the orbat manager, creating new nodes as necessary.
virtual DtOrbatDataList removeObjectsFromOrbat (const DtOrbatDataList &)
 Removes all the specified objects from the orbat.
virtual DtOrbatDataList removeObjectFromOrbat (const DtRwOrbatData &, bool onlyPublished=false)
 Removes the specified object from the orbat.
virtual void sendOrbatList (int requestId=0)
 Sends off a flat list of all the orbat items that are marked as part of the orbat. Up to receiver to reconstitute into a tree, if need be.
virtual void clearOrbat (bool send=false)
 Clears out any objects are are in the orbat only. If is orbat enabled and send flag is true will send an empty orbat list out.
virtual void mergeFrom (const DtOrbatManager &fromOm, bool sendNewList=false)
 Merges orbat items from the given orbat into this orbat.
virtual bool loadOrbat (const DtFilename &, bool send=false, bool clearOnLoad=true)
 Loads the scenario scripts from the specified file. If send is true sends out all scripts onto the network.
virtual bool loadOrbatFromZipFile (const DtFilename &scenarioZipFile, const std::string &, bool send=false, bool clearOnLoad=true)
virtual bool loadOrbat (const std::string &str, bool send=false, bool clearOnLoad=true)
 Loads the scenario scripts from the given string.
virtual bool writeOrbat (const DtFilename &)
 Writes the local scenario scripts to the specified file.
virtual bool writeOrbat (std::string &)
 Writes the local scenario scripts to the specified string.
virtual DtOrbatManagerNodeaddNode (const DtRwOrbatData &)
 Adds a node without expansion or hooking to child/parent.
virtual DtOrbatManagerNodelookupNodeByUUID (const DtUUID &id) const
virtual DtOrbatManagerNodelookupNodeByMarkingText (const DtString &) const
 Looks up and returns node by marking text.
const UUIDMapnodes () const
virtual DtOrbatDataList modifyOrbatObjects (const DtOrbatDataList &)
 Modify orbat hierarchy given the nodes to modify. Will return a list of changed nodes.
virtual DtOrbatDataList modifyOrbatObject (const DtRwOrbatData &)
 Modify orbat hierarchy given the nodes to modify.
virtual DtVrfObjectcreateOrReturnSuperiorOf (const DtUUID &, const DtVector &locationOfSuperior=DtVector::zero())
 If this is part of the orbat, and there is a parent for this object, return that parent.
virtual void createSubordinatesOfObject (const DtUUID &)
 If this object is in the orbat and has uncreated subordinates, create them and parent them to their superior.
virtual void tick ()
 Perform any pending operations.
virtual void aboutToDeleteObjectManager ()
virtual void processVrfObjectAdded (DtVrfObject *, int flags=0)
virtual void makeAllSimulationObjectsPartOfOrbat ()
 For any simulation object that is not currently part of the ORBAT, call processVrfObjectAdded on it to make it part of the ORBAT.

Protected Types

typedef std::vector
< DtOrbatManagerNode * > 
OrbatNodeList
typedef std::map< DtUUID,
OrbatNodeList
UnparentedOrbatNodes
typedef std::map< DtUUID,
DtOrganizationManagerNode * > 
WatchedNodes
typedef std::map< int,
DtOrbatManagerNode * > 
RootNodesByForce

Protected Member Functions

virtual DtString trimNameForLength (int maxLength, const DtString &) const
 If the marking text is >= max length, trims end.
virtual DtOrbatManagerNodecreateOrbatManagerNode () const
 Creates a new node to put into the hierarchy.
virtual void processOrbatOperation (DtSimMessage *msg)
 Process an orbat operation.
virtual DtOrbatDataList createOrbatNodes (const DtRwOrbatData &, int flags=DtIfOrbatOperation::IterateChildrenOnAdd)
 Creates orbat nodes based on the orbat data.
virtual bool loadOrbat (DtlInputStream *, bool send)
virtual DtString generateMarkingText (const DtEntityType &)
 Given an entity type generate unique marking text.
virtual void processVrfObjectAboutToBeRemoved (DtVrfObject *)
virtual void processOrganizationManagerNodeAdded (const DtUUID &)
virtual void processOrganizationManagerNodeAdded (DtOrganizationManagerNode *)
virtual void removeWatchedNode (const DtUUID &)
virtual void processChildAdded (const DtUUID &superior, const DtUUID &subordinate)
virtual void processChildRemoved (const DtUUID &superior, const DtUUID &subordinate)
virtual void processOrganizationManagerNodeAboutToBeRemoved (const DtUUID &)
virtual void processOrbatNodeRemoved (const DtUUID &, const DtUUID &)
virtual void reorderOrbatNodesExcluding (DtOrbatManagerNode *)
 Reorders the orbat order of any node that are after the orbat order of the specified node that share the same parent by the amount specified.
virtual void setOrbatNodeOrder (DtOrbatManagerNode *, int order, bool inserting=false)
 Sets the order of the orbat node, reording others as needed.
virtual void insertOrbatNodeInOrder (DtOrbatManagerNode *, int order)
virtual DtOrbatManagerNoderootNodeForForce (int)
virtual void processObjectDataChanged (DtVrfObject *, int flag)
virtual DtOrbatDataList setForceToSubordinatesOf (int force, DtOrbatManagerNode *) const
 Sets the force of all the subordinates (recursive) of the orbat node to the given force and returns a list of all nodes affected.

Static Protected Member Functions

static void orbatOperationCallback (DtSimMessage *msg, void *usr)
static void vrfObjectAdded (DtVrfObject *, void *usr)
static void vrfObjectAboutToBeRemoved (DtVrfObject *, void *usr)
static void organizationManagerNodeAdded (const DtUUID &, void *)
 Called when a node is added, add callbacks on that node for when anything changes about it so we can change the orbat hierarchy, if need be.
static void childAddedCallback (const DtUUID &superior, const DtUUID &subordinate, void *usr)
static void childRemovedCallback (const DtUUID &superior, const DtUUID &subordinate, void *usr)
static void organizationManagerNodeAboutToBeRemoved (const DtUUID &, void *)
static void orbatNodeRemovedCallback (const DtUUID &, const DtUUID &, void *)
static void objectDataChangedCallback (DtVrfObject *, int flag, void *usr)

Protected Attributes

bool myIsOrbatEnabled
UnparentedOrbatNodes myUnparentedOrbatNodes
UUIDMap myOrbatNodes
DtVrfObjectManagermyObjectManager
std::map< std::string, intmyEntityTypeCounts
 Number of items used by entity type so unique name can be generated when adding nodes to the orbat.
WatchedNodes myWatchedNodes
UUIDMap myModifiedNodes
 Map of modified nodes to be sent off during a tick.
RootNodesByForce myRootNodesByForce
DtIsOrbatEnabledCommand * myIsOrbatEnabledCommand
DtSetIsOrbatEnabledCommand * mySetIsOrbatEnabledCommand

Private Member Functions

 DtOrbatManager ()
 Default constructor not implemented.
 DtOrbatManager (const DtOrbatManager &orig)
 Copy constructor not implemented.
DtOrbatManageroperator= (const DtOrbatManager &orig)
 Assignment operator not implemented.

Detailed Description

This class derives from the DtOrganizationManager and will handle all requests as it pertains to the orbat.

It will use the organization manager hierarchy to install nodes that can be created in the scenario (if they are not already created) and whether or not the created nodes are part of the orbat system.

Member Typedef Documentation

typedef boost::unordered_map<DtUUID, DtOrbatManagerNode*> DtOrbatManager::UUIDMap
typedef std::vector<DtOrbatManagerNode*> DtOrbatManager::OrbatNodeList
protected

Constructor & Destructor Documentation

DtOrbatManager::DtOrbatManager ( )
private

Default constructor not implemented.

DtOrbatManager::DtOrbatManager ( const DtOrbatManager orig)
private

Copy constructor not implemented.

DtOrbatManager::DtOrbatManager ( DtVrfObjectManager objMgr)

Constructor.

virtual DtOrbatManager::~DtOrbatManager ( )
virtual

Destructor.

Member Function Documentation

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

Assignment operator not implemented.

virtual bool DtOrbatManager::init ( )
virtual
virtual void DtOrbatManager::closingScenario ( )
virtual

Called when scenario is closing. Can perform some cleanup.

virtual void DtOrbatManager::setOrbatEnabled ( bool  )
virtual

Sets whether or not this is enabled to process orbat messages. Default is false.

virtual bool DtOrbatManager::orbatEnabled ( ) const
virtual
virtual DtOrbatDataList DtOrbatManager::addOrUpdateObjectsInOrbat ( const DtOrbatDataList ,
int  flags = DtIfOrbatOperation::IterateChildrenOnAdd 
)
virtual

Adds the specified orbat items to the orbat manager, creating new nodes as necessary.

What will be returned is the orbat data created in response to this operation

virtual DtOrbatDataList DtOrbatManager::removeObjectsFromOrbat ( const DtOrbatDataList )
virtual

Removes all the specified objects from the orbat.

If any of the objects are a superior, all subordinates in the orbat are removed. Returns objects removed

virtual DtOrbatDataList DtOrbatManager::removeObjectFromOrbat ( const DtRwOrbatData ,
bool  onlyPublished = false 
)
virtual

Removes the specified object from the orbat.

If any of the objects are a superior, all subordinates in the orbat are removed. Returns objects removed

virtual void DtOrbatManager::sendOrbatList ( int  requestId = 0)
virtual

Sends off a flat list of all the orbat items that are marked as part of the orbat. Up to receiver to reconstitute into a tree, if need be.

virtual void DtOrbatManager::clearOrbat ( bool  send = false)
virtual

Clears out any objects are are in the orbat only. If is orbat enabled and send flag is true will send an empty orbat list out.

virtual void DtOrbatManager::mergeFrom ( const DtOrbatManager fromOm,
bool  sendNewList = false 
)
virtual

Merges orbat items from the given orbat into this orbat.

virtual bool DtOrbatManager::loadOrbat ( const DtFilename &  ,
bool  send = false,
bool  clearOnLoad = true 
)
virtual

Loads the scenario scripts from the specified file. If send is true sends out all scripts onto the network.

virtual bool DtOrbatManager::loadOrbatFromZipFile ( const DtFilename &  scenarioZipFile,
const std::string &  ,
bool  send = false,
bool  clearOnLoad = true 
)
virtual
virtual bool DtOrbatManager::loadOrbat ( const std::string &  str,
bool  send = false,
bool  clearOnLoad = true 
)
virtual

Loads the scenario scripts from the given string.

virtual bool DtOrbatManager::writeOrbat ( const DtFilename &  )
virtual

Writes the local scenario scripts to the specified file.

virtual bool DtOrbatManager::writeOrbat ( std::string &  )
virtual

Writes the local scenario scripts to the specified string.

virtual DtOrbatManagerNode* DtOrbatManager::addNode ( const DtRwOrbatData )
virtual

Adds a node without expansion or hooking to child/parent.

virtual DtOrbatManagerNode* DtOrbatManager::lookupNodeByUUID ( const DtUUID id) const
virtual
virtual DtOrbatManagerNode* DtOrbatManager::lookupNodeByMarkingText ( const DtString ) const
virtual

Looks up and returns node by marking text.

If there are multiple items with the same marking text will return the first it finds

const UUIDMap& DtOrbatManager::nodes ( ) const
inline
virtual DtOrbatDataList DtOrbatManager::modifyOrbatObjects ( const DtOrbatDataList )
virtual

Modify orbat hierarchy given the nodes to modify. Will return a list of changed nodes.

virtual DtOrbatDataList DtOrbatManager::modifyOrbatObject ( const DtRwOrbatData )
virtual

Modify orbat hierarchy given the nodes to modify.

If attached to a parent and that parent is not in the orbat view, will create a new parent for that, and walk the chain as long as the parent nodes are not created

virtual DtVrfObject* DtOrbatManager::createOrReturnSuperiorOf ( const DtUUID ,
const DtVector locationOfSuperior = DtVector::zero() 
)
virtual

If this is part of the orbat, and there is a parent for this object, return that parent.

If there should be a parent and there is no parent created create it locall via a DtIfCreateVrfObject message. Pass in a location if you want to use that as a seed location. The location is geocentric

virtual void DtOrbatManager::createSubordinatesOfObject ( const DtUUID )
virtual

If this object is in the orbat and has uncreated subordinates, create them and parent them to their superior.

virtual void DtOrbatManager::tick ( )
virtual

Perform any pending operations.

virtual void DtOrbatManager::aboutToDeleteObjectManager ( )
virtual
virtual void DtOrbatManager::processVrfObjectAdded ( DtVrfObject ,
int  flags = 0 
)
virtual
virtual void DtOrbatManager::makeAllSimulationObjectsPartOfOrbat ( )
virtual

For any simulation object that is not currently part of the ORBAT, call processVrfObjectAdded on it to make it part of the ORBAT.

If the DtDoNotAddToOrbat flag is set for vrf objects it will be removed so they will be added to the ORBAT

virtual DtString DtOrbatManager::trimNameForLength ( int  maxLength,
const DtString  
) const
protectedvirtual

If the marking text is >= max length, trims end.

virtual DtOrbatManagerNode* DtOrbatManager::createOrbatManagerNode ( ) const
protectedvirtual

Creates a new node to put into the hierarchy.

virtual void DtOrbatManager::processOrbatOperation ( DtSimMessage msg)
protectedvirtual

Process an orbat operation.

static void DtOrbatManager::orbatOperationCallback ( DtSimMessage msg,
void *  usr 
)
staticprotected
virtual DtOrbatDataList DtOrbatManager::createOrbatNodes ( const DtRwOrbatData ,
int  flags = DtIfOrbatOperation::IterateChildrenOnAdd 
)
protectedvirtual

Creates orbat nodes based on the orbat data.

It will look up the parameter data for the given entity type, and, if that entity type is an aggregate will recursively create nodes for all subordinates in that aggregate and add them to the orbat with pre-generated unique ids

virtual bool DtOrbatManager::loadOrbat ( DtlInputStream *  ,
bool  send 
)
protectedvirtual
virtual DtString DtOrbatManager::generateMarkingText ( const DtEntityType &  )
protectedvirtual

Given an entity type generate unique marking text.

static void DtOrbatManager::vrfObjectAdded ( DtVrfObject ,
void *  usr 
)
staticprotected
static void DtOrbatManager::vrfObjectAboutToBeRemoved ( DtVrfObject ,
void *  usr 
)
staticprotected
virtual void DtOrbatManager::processVrfObjectAboutToBeRemoved ( DtVrfObject )
protectedvirtual
static void DtOrbatManager::organizationManagerNodeAdded ( const DtUUID ,
void *   
)
staticprotected

Called when a node is added, add callbacks on that node for when anything changes about it so we can change the orbat hierarchy, if need be.

virtual void DtOrbatManager::processOrganizationManagerNodeAdded ( const DtUUID )
protectedvirtual
virtual void DtOrbatManager::processOrganizationManagerNodeAdded ( DtOrganizationManagerNode )
protectedvirtual
virtual void DtOrbatManager::removeWatchedNode ( const DtUUID )
protectedvirtual
static void DtOrbatManager::childAddedCallback ( const DtUUID superior,
const DtUUID subordinate,
void *  usr 
)
staticprotected
virtual void DtOrbatManager::processChildAdded ( const DtUUID superior,
const DtUUID subordinate 
)
protectedvirtual
static void DtOrbatManager::childRemovedCallback ( const DtUUID superior,
const DtUUID subordinate,
void *  usr 
)
staticprotected
virtual void DtOrbatManager::processChildRemoved ( const DtUUID superior,
const DtUUID subordinate 
)
protectedvirtual
static void DtOrbatManager::organizationManagerNodeAboutToBeRemoved ( const DtUUID ,
void *   
)
staticprotected
virtual void DtOrbatManager::processOrganizationManagerNodeAboutToBeRemoved ( const DtUUID )
protectedvirtual
static void DtOrbatManager::orbatNodeRemovedCallback ( const DtUUID ,
const DtUUID ,
void *   
)
staticprotected
virtual void DtOrbatManager::processOrbatNodeRemoved ( const DtUUID ,
const DtUUID  
)
protectedvirtual
virtual void DtOrbatManager::reorderOrbatNodesExcluding ( DtOrbatManagerNode )
protectedvirtual

Reorders the orbat order of any node that are after the orbat order of the specified node that share the same parent by the amount specified.

virtual void DtOrbatManager::setOrbatNodeOrder ( DtOrbatManagerNode ,
int  order,
bool  inserting = false 
)
protectedvirtual

Sets the order of the orbat node, reording others as needed.

virtual void DtOrbatManager::insertOrbatNodeInOrder ( DtOrbatManagerNode ,
int  order 
)
protectedvirtual
virtual DtOrbatManagerNode* DtOrbatManager::rootNodeForForce ( int  )
protectedvirtual
static void DtOrbatManager::objectDataChangedCallback ( DtVrfObject ,
int  flag,
void *  usr 
)
staticprotected
virtual void DtOrbatManager::processObjectDataChanged ( DtVrfObject ,
int  flag 
)
protectedvirtual
virtual DtOrbatDataList DtOrbatManager::setForceToSubordinatesOf ( int  force,
DtOrbatManagerNode  
) const
protectedvirtual

Sets the force of all the subordinates (recursive) of the orbat node to the given force and returns a list of all nodes affected.

Member Data Documentation

bool DtOrbatManager::myIsOrbatEnabled
protected
UnparentedOrbatNodes DtOrbatManager::myUnparentedOrbatNodes
protected
UUIDMap DtOrbatManager::myOrbatNodes
protected
DtVrfObjectManager* DtOrbatManager::myObjectManager
protected
std::map<std::string, int> DtOrbatManager::myEntityTypeCounts
protected

Number of items used by entity type so unique name can be generated when adding nodes to the orbat.

WatchedNodes DtOrbatManager::myWatchedNodes
protected
UUIDMap DtOrbatManager::myModifiedNodes
protected

Map of modified nodes to be sent off during a tick.

RootNodesByForce DtOrbatManager::myRootNodesByForce
protected
DtIsOrbatEnabledCommand* DtOrbatManager::myIsOrbatEnabledCommand
protected
DtSetIsOrbatEnabledCommand* DtOrbatManager::mySetIsOrbatEnabledCommand
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)