VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
search.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 
10 
11 class DtVrfObject;
12 
13 //
14 //class MySearch:
15 //
16 //Instances of MySearch are used to search an entity or an entire aggregate
17 //structure for entities that are facing north. If any are detected the search
18 //is terminated. Call the searchBelow() function to do the actual
19 //search. Test the result by calling result().
20 //
21 
23 {
24 public:
25  //default constructor
26  MySearch();
27 
28  //destructor
29  virtual ~MySearch();
30 
31 protected:
32  //Function to initialize the search. Sets myAnyFlag and myResult based on
33  //myModifier. If the "ANY" modifier is used, myResult is intialized to
34  //false (and set to true on the first success) otherwise myResult
35  //is set to true (and set to false on the first failure).
36  virtual bool initializeSearch(DtSimObjectReference entity);
37 
38  //Test any and all entities to find one that is destroyed and sets
39  //myResult. If the test is true and the any flag is set, it returns true
40  //(which continues the search). Otherwise false is returned to end the
41  //search.
42  virtual bool inspectEntity(DtSimObjectReference entity);
43 
44  //Controls whether subordinates of a specified pseudo-aggregate are
45  //searched. If the "ANY" modifier was specified, it calls the base
46  //class version, otherwise it just returns false.
47  virtual bool searchSubordinates(
48  DtSimObjectReference pAggEntity, bool excludeDestroyed);
49 
50 protected:
51  //copy constructor; not implemented
52  MySearch(const MySearch& orig);
53 
54  //assignment operator; not implemented
55  MySearch& operator=(const MySearch& orig);
56 };
Definition: search.h:22
MySearch & operator=(const MySearch &orig)
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
virtual bool initializeSearch(DtSimObjectReference entity)
Override initializeSearch if you need to do some initialization at the start of the search process...
class DtSimSubordinateSearch:
Definition: simSubordinateSearch.h:24
virtual bool inspectEntity(DtSimObjectReference entity)
Override inspectEntity to do any tests you want to do on base entities that are found in the search...
virtual bool searchSubordinates(DtSimObjectReference pAggEntity, bool excludeDestroyed)
SearchSubordinates will call searchSubtree on all the immediate children of a given pseudo aggregate...
virtual ~MySearch()
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)