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 Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtSimSubordinateSearch Class Reference

class DtSimSubordinateSearch: More...

Inheritance diagram for DtSimSubordinateSearch:
Inheritance graph
[legend]

Public Member Functions

 DtSimSubordinateSearch ()
 default constructor
virtual ~DtSimSubordinateSearch ()=0
 destructor
bool search (const DtUUID &search, const DtUUID &evaluator, DtSimManager *simManager)
 If the first field of the modifier is "PATTERN" or "SELF", this function will parse out any additional arguments for those searches.
virtual const DtStringmodifier () const
 Get the test modifier string.
virtual void setModifier (const DtString &modifier)
 Set the test modifier.
virtual bool searchBelow (const DtVrfObject &entity, bool excludeDestroyed)
 Call searchBelow to search the echelon hierarchy below a given entity.
virtual bool searchBelow (const DtVrfObjectManager *mgr, int iForce, bool excludeDestroyed)
 This call will take an object manager and a force type over which to check the subtree against entities of that type.
virtual bool result ()
 Result function: returns true if it found a matching entity.
virtual bool isTopLevelEntity (const DtString &entity) const
 Returns true if entity supplied is a top level entity.
virtual bool isValidEntity (const DtVrfObject &entity)
 Returns true if the object is an aggregate, a platform, or a lifeform or cultural feature.
virtual int forceType (const DtString &entity) const
 Returns the force type of the entity based on the name pattern (1 Force, 2 Force, etc.) If name does not follow pattern, returns -1.
virtual const DtUUIDsimulationObject () const
 The object that satisfied the search.

Protected Member Functions

virtual bool initializeSearch (const DtVrfObject &entity)
 Override initializeSearch if you need to do some initialization at the start of the search process.
virtual bool initializeSearch (const DtVrfObjectManager *vrfObjectManager)
virtual bool inspectEntity (const DtVrfObject &entity)
 Override inspectEntity to do any tests you want to do on base entities that are found in the search.
bool inspectTopLevelEntity (const DtVrfObject &entity, bool excludeDestroyed)
bool inspectAggregateEntity (const DtVrfObject &entity, bool excludeDestroyed)
virtual bool searchSubtree (const DtVrfObject &entity, bool excludeDestroyed)
 This function calls one of the inspect functions based on the type of the given entity.
virtual bool searchSubordinates (const DtVrfObject &entity, bool excludeDestroyed)
 SearchSubordinates will call searchSubtree on all the immediate children of a given pseudo aggregate.

Protected Attributes

DtString myModifier
bool myAnyFlag
bool myResult
DtUUID mySimulationObject

Private Member Functions

 DtSimSubordinateSearch (const DtSimSubordinateSearch &orig)
 copy constructor; not implemented
DtSimSubordinateSearchoperator= (const DtSimSubordinateSearch &orig)
 assignment operator; not implemented

Detailed Description

class DtSimSubordinateSearch:

Instances of DtSimSubordinateSearch are used as a base class for function classes that iterate over the echelon tree.

Constructor & Destructor Documentation

DtSimSubordinateSearch::DtSimSubordinateSearch ( )

default constructor

virtual DtSimSubordinateSearch::~DtSimSubordinateSearch ( )
pure virtual

destructor

DtSimSubordinateSearch::DtSimSubordinateSearch ( const DtSimSubordinateSearch orig)
private

copy constructor; not implemented

Member Function Documentation

bool DtSimSubordinateSearch::search ( const DtUUID search,
const DtUUID evaluator,
DtSimManager simManager 
)

If the first field of the modifier is "PATTERN" or "SELF", this function will parse out any additional arguments for those searches.

In the case of a pattern search, predicates are created and searchBelow is called on each matching item. In the case of a self search, searchBelow is called on the object which corresponds to the evaluatorObjectName. Otherwise, searchBelow is called on the entity which corresponds to searchName.

virtual const DtString& DtSimSubordinateSearch::modifier ( ) const
virtual

Get the test modifier string.

virtual void DtSimSubordinateSearch::setModifier ( const DtString modifier)
virtual

Set the test modifier.

If it is an empty string, checks only the specified entity. If it is the string "ANY", checks all subordinate entities to see if any of them match the test, If it is neither of the above, it requires that all specified entities match.

virtual bool DtSimSubordinateSearch::searchBelow ( const DtVrfObject entity,
bool  excludeDestroyed 
)
virtual

Call searchBelow to search the echelon hierarchy below a given entity.

It returns true only if it stopped the search before running out of entities to check. The results of the search will be stored in the derived search class.

Note that for searching purposes, the names "1 Force", "2 Force", etc. are considered "reserved" names to signify using all entities from that particular force (friendly, opposing, other, etc.). Since this is the case, you need to avoid naming entities in your simulation 1 Force, 2 Force, etc. that will be used in simulations and plans.

virtual bool DtSimSubordinateSearch::searchBelow ( const DtVrfObjectManager mgr,
int  iForce,
bool  excludeDestroyed 
)
virtual

This call will take an object manager and a force type over which to check the subtree against entities of that type.

virtual bool DtSimSubordinateSearch::result ( )
virtual

Result function: returns true if it found a matching entity.

virtual bool DtSimSubordinateSearch::isTopLevelEntity ( const DtString entity) const
virtual

Returns true if entity supplied is a top level entity.

Calls "forceType()", and, if force type returns a number that is not -1, this method will return true

virtual bool DtSimSubordinateSearch::isValidEntity ( const DtVrfObject entity)
virtual

Returns true if the object is an aggregate, a platform, or a lifeform or cultural feature.

Reimplemented in DtSurrenderSearch.

virtual int DtSimSubordinateSearch::forceType ( const DtString entity) const
virtual

Returns the force type of the entity based on the name pattern (1 Force, 2 Force, etc.) If name does not follow pattern, returns -1.

virtual const DtUUID& DtSimSubordinateSearch::simulationObject ( ) const
virtual

The object that satisfied the search.

virtual bool DtSimSubordinateSearch::initializeSearch ( const DtVrfObject entity)
protectedvirtual

Override initializeSearch if you need to do some initialization at the start of the search process.

It will only be called once per search before any of the inspect functions are called, and if this function returns false, then the search is canceled. By default it returns true.

Reimplemented in MySearch.

virtual bool DtSimSubordinateSearch::initializeSearch ( const DtVrfObjectManager vrfObjectManager)
protectedvirtual
virtual bool DtSimSubordinateSearch::inspectEntity ( const DtVrfObject entity)
protectedvirtual

Override inspectEntity to do any tests you want to do on base entities that are found in the search.

It should return true only if it has found what it is looking for and wants to terminate the search early. By default it simply returns false. It is usually called either because a non-local entity has been found and the default version of inspectRemoteEntity was called, or because a local entity was found and the default version of inspectLocalEntity was called.

Reimplemented in DtEntDiGuySearch, DtEntAltitudeSearch, DtEntInAreaSearch, DtSurrenderSearch, DtEntLeftOfLineSearch, DtEntDestroyedSearch, DtEntEmbarkationStateChangedSearch, DtEntHasTargetSearch, DtEntUnderFireSearch, DtCheckEntityIdLevelSearch, and MySearch.

bool DtSimSubordinateSearch::inspectTopLevelEntity ( const DtVrfObject entity,
bool  excludeDestroyed 
)
protected
bool DtSimSubordinateSearch::inspectAggregateEntity ( const DtVrfObject entity,
bool  excludeDestroyed 
)
protected
virtual bool DtSimSubordinateSearch::searchSubtree ( const DtVrfObject entity,
bool  excludeDestroyed 
)
protectedvirtual

This function calls one of the inspect functions based on the type of the given entity.

Note: if given a force-level entity to search, it calls inspectTopLevelEntity.

virtual bool DtSimSubordinateSearch::searchSubordinates ( const DtVrfObject entity,
bool  excludeDestroyed 
)
protectedvirtual

SearchSubordinates will call searchSubtree on all the immediate children of a given pseudo aggregate.

Reimplemented in DtEntDiGuySearch, DtEntAltitudeSearch, DtEntInAreaSearch, DtEntLeftOfLineSearch, DtSurrenderSearch, DtEntDestroyedSearch, DtEntEmbarkationStateChangedSearch, DtEntHasTargetSearch, DtEntUnderFireSearch, DtCheckEntityIdLevelSearch, and MySearch.

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

assignment operator; not implemented

Member Data Documentation

DtString DtSimSubordinateSearch::myModifier
protected
bool DtSimSubordinateSearch::myAnyFlag
protected
bool DtSimSubordinateSearch::myResult
protected
DtUUID DtSimSubordinateSearch::mySimulationObject
protected

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)