VR-Forces Developer's Guide
 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 Referenceabstract

class DtSimSubordinateSearch:

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

Inheritance diagram for DtSimSubordinateSearch:
Inheritance graph
[legend]

Public Member Functions

 DtSimSubordinateSearch ()
 
virtual ~DtSimSubordinateSearch ()=0
 
bool search (const DtUUID &search, DtLocalObject *owner, const DtSimulationServices *)
 
virtual const DtStringmodifier () const
 
virtual void setModifier (const DtString &modifier)
 
virtual bool searchBelow (DtSimObjectReference entity, bool excludeDestroyed)
 
virtual bool searchBelow (DtLocalObject *entity, DtSimObjectReference targetOfCheck, bool excludeDestroyed)
 
virtual bool searchBelow (int iForce, bool excludeDestroyed)
 
virtual bool result ()
 
virtual bool isTopLevelEntity (const DtString &entity) const
 
virtual bool isValidEntity (DtSimObjectReference entity)
 
virtual int forceType (const DtString &entity) const
 
virtual const DtUUIDsimulationObject () const
 

Protected Member Functions

virtual bool initializeSearch (DtSimObjectReference entity)
 
virtual bool initializeSearch (const DtSimulationServices *vrfObjectManager)
 
virtual bool inspectEntity (DtSimObjectReference entity)
 
virtual bool isForSelfOnly () const
 
virtual bool inspectEntity (DtLocalObject *entity, DtSimObjectReference targetOfCheck)
 
virtual bool inspectTopLevelEntity (DtSimObjectReference entity, bool excludeDestroyed)
 
virtual bool inspectAggregateEntity (DtSimObjectReference entity, bool excludeDestroyed)
 
virtual bool searchSubtree (DtSimObjectReference entity, bool excludeDestroyed)
 
virtual bool searchSubtree (DtLocalObject *entity, DtSimObjectReference targetOfCheck, bool excludeDestroyed)
 
virtual bool searchSubordinates (DtSimObjectReference entity, bool excludeDestroyed)
 

Protected Attributes

DtString myModifier
 
bool myAnyFlag
 
bool myResult
 
DtUUID mySimulationObject
 
const DtSimulationServicesmySimulationServices
 

Private Member Functions

 DtSimSubordinateSearch (const DtSimSubordinateSearch &orig)
 
DtSimSubordinateSearchoperator= (const DtSimSubordinateSearch &orig)
 

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,
DtLocalObject owner,
const DtSimulationServices  
)

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 ( DtSimObjectReference  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 ( DtLocalObject entity,
DtSimObjectReference  targetOfCheck,
bool  excludeDestroyed 
)
virtual

Called when only looking at self.

virtual bool DtSimSubordinateSearch::searchBelow ( 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 ( DtSimObjectReference  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 ( DtSimObjectReference  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 DtSimulationServices vrfObjectManager)
protectedvirtual
virtual bool DtSimSubordinateSearch::inspectEntity ( DtSimObjectReference  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 DtEntInRangeSearch, DtEntDiGuySearch, DtEntInAreaSearch, DtEntLeftOfLineSearch, DtCheckEntityIdLevelSearch, DtEntEmbarkationStateChangedSearch, DtEntAltitudeSearch, MySearch, DtEntIndependentlyTaskedSearch, DtSurrenderSearch, DtEntDestroyedSearch, DtEntHasTargetSearch, and DtEntUnderFireSearch.

virtual bool DtSimSubordinateSearch::isForSelfOnly ( ) const
protectedvirtual

If the subordinate search is one that only allows for self to be used, then this is the method that will be called, else the simObjectReference version will be called. Default is false.

virtual bool DtSimSubordinateSearch::inspectEntity ( DtLocalObject entity,
DtSimObjectReference  targetOfCheck 
)
protectedvirtual

Reimplemented in DtCheckEntityIdLevelSearch.

virtual bool DtSimSubordinateSearch::inspectTopLevelEntity ( DtSimObjectReference  entity,
bool  excludeDestroyed 
)
protectedvirtual
virtual bool DtSimSubordinateSearch::inspectAggregateEntity ( DtSimObjectReference  entity,
bool  excludeDestroyed 
)
protectedvirtual
virtual bool DtSimSubordinateSearch::searchSubtree ( DtSimObjectReference  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::searchSubtree ( DtLocalObject entity,
DtSimObjectReference  targetOfCheck,
bool  excludeDestroyed 
)
protectedvirtual
virtual bool DtSimSubordinateSearch::searchSubordinates ( DtSimObjectReference  entity,
bool  excludeDestroyed 
)
protectedvirtual
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
const DtSimulationServices* DtSimSubordinateSearch::mySimulationServices
protected

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)