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() override;
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) override;
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) override;
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(DtSimObjectReference pAggEntity, bool excludeDestroyed) override;
48 
49 protected:
50  //copy constructor; not implemented
51  MySearch(const MySearch& orig);
52 
53  //assignment operator; not implemented
54  MySearch& operator=(const MySearch& orig);
55 };
Definition: search.h:22
MySearch & operator=(const MySearch &orig)
virtual bool inspectEntity(DtSimObjectReference entity) override
Override inspectEntity to do any tests you want to do on base entities that are found in the search...
class DtSimSubordinateSearch:
Definition: simSubordinateSearch.h:24
virtual bool initializeSearch(DtSimObjectReference entity) override
Override initializeSearch if you need to do some initialization at the start of the search process...
virtual ~MySearch() override
virtual bool searchSubordinates(DtSimObjectReference pAggEntity, bool excludeDestroyed) override
SearchSubordinates will call searchSubtree on all the immediate children of a given pseudo aggregate...
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)