VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleRadarWarnRx.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 #include <vrfutil/rwUUID.h>
10 
11 //class DtSimpleRadarWarningReceiver:
12 //
13 //Instances of DtSimpleRadarWarningReceiver are an example of a simple radar
14 //warning reciever. For the purposes of example this receiver determines
15 //that it has detected a remote radar if a given remote emitter system
16 //is located within a given distance from the entity configured with the
17 //reciever. The list of radar emitters sensed this tick is generated as
18 //output.
19 
22 
24 {
25 public:
26  //constructor
29  DtReaderWriterRegistry * parentRegistry = 0);
30 
31  //destructor
33 
34  //This returns a string that uniquely identifies this type of component.
35  //(must be unique with respect to the component types defined in compTypes.h
36  //as well as any additional user-defined components). Returns the string
37  //"simple-radar-warning-receiver".
38  virtual const char* type() const;
39 
40  //This is the entity we're detecting for. We override because we
41  //want to grab and cache the global object designator.
42  virtual void setEntity(DtLocalObject* entity);
43 
44  //Detects emitters and places them on our port.
45  virtual void tick();
46 
47  //Returns the list of emitters we've detected.
48  virtual DtEntityListOutputPort* emitterListPort() const;
49 
50  //Returns a newly created instance of this class. We need to provide
51  //this function so that we can register this class with the component
52  //factory.
53  static DtSimComponent * creator(const DtString & name, DtLocalObject* owner,
55  DtReaderWriterRegistry * parentRegistry);
56 
57 protected:
58 
59  //Overridden to create myEmitterListPort
60  virtual bool createPorts();
61 
62 protected:
63  //Default constructor; should not be called. Here because the compiler
64  //will generate an unprotected one otherwise.
66 
67  //copy constructor, not implemented
69 
70  //assignment operator, not implemented
72  const DtSimpleRadarWarningReceiver& orig);
73 
74 protected:
75 
76  //Port used to communicate the list of detected emitter systems to
77  //other components.
79 
80  //The id of the entity this receiver is mounted on.
82 
83  //Pointer to the descriptor that holds the initialization parameters for this component.
84  //This pointer is const because all instances of this component share a single
85  //descriptor instance, so they should not be writing data back to it.
87 
88  // Hash key for multiple level of trace in tracy
90 };
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
Definition: radarWarningReceiverDesc.h:20
virtual void setEntity(DtLocalObject *entity)
The entity&#39;s state repository is the place that actuator components make updates and other components...
DtSimpleRadarWarningReceiver & operator=(const DtSimpleRadarWarningReceiver &orig)
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry)
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
Contains the DtUUID class declaration.
Definition: simpleRadarWarnRx.h:23
Instances of DtEntityListOutputPort are output ports through which data producers can send a list of ...
Definition: entListIOPort.h:45
virtual DtEntityListOutputPort * emitterListPort() const
DtEntityListOutputPort * myEmitterListPort
Definition: simpleRadarWarnRx.h:78
virtual const char * type() const
Returns a string identifies the class type of component. Type values are defined in compTypes...
size_t theMyExternalDllModuleName
Definition: simpleRadarWarnRx.h:89
DtUUID myUUID
Definition: simpleRadarWarnRx.h:81
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:89
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
VRF4API_METHOD const DtSimulationServices * simManager() const
This is the deprecated API that can be used as a reference to migrate 4.X code to 5...
Definition: simComponent.h:566
Contains the DtSimComponent class declaration.
DtLocalObject * entity()
Gets the entity.
Definition: simComponent.h:369
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.
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
const DtRadarWarningReceiverDescriptor * myDescriptor
Definition: simpleRadarWarnRx.h:86

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)