VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtSimSubordinateSearch Class Reference

class DtSimSubordinateSearch: More...

Inheritance diagram for DtSimSubordinateSearch:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtSimSubordinateSearch ()
 default constructor
virtual ~DtSimSubordinateSearch ()=0
 destructor
bool search (const DtString &searchName, const DtString &evaluatorObjectName, 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)
 Call searchBelow to search the echelon hierarchy below a given entity.
virtual bool searchBelow (const DtVrfObjectManager *mgr, int iForce)
 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.

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 inspectAggregateEntity (const DtVrfObject &entity)
virtual bool searchSubtree (const DtVrfObject &entity)
 This function calls one of the inspect functions based on the type of the given entity.
virtual bool searchSubordinates (const DtVrfObject &entity)
 SearchSubordinates will call searchSubtree on all the immediate children of a given pseudo aggregate.

Protected Attributes

DtString myModifier
bool myAnyFlag
bool myResult

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

default constructor

destructor

copy constructor; not implemented


Member Function Documentation

bool DtSimSubordinateSearch::search ( const DtString searchName,
const DtString evaluatorObjectName,
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) [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 
) [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 bool DtSimSubordinateSearch::initializeSearch ( const DtVrfObject entity) [protected, virtual]

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) [protected, virtual]
virtual bool DtSimSubordinateSearch::inspectEntity ( const DtVrfObject entity) [protected, virtual]

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, DtEntInAreaSearch, DtEntAltitudeSearch, DtEntLeftOfLineSearch, DtEntEmbarkationStateChangedSearch, DtSurrenderSearch, DtCheckEntityIdLevelSearch, DtEntDestroyedSearch, DtEntHasTargetSearch, DtEntUnderFireSearch, and MySearch.

virtual bool DtSimSubordinateSearch::searchSubtree ( const DtVrfObject entity) [protected, virtual]

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) [protected, virtual]

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

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

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

assignment operator; not implemented


Member Data Documentation


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)