VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aggregateWeaponListResponder.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
13 
17 
18 #include <map>
19 
21 class DtString;
23 class DtSimMessage;
24 
25 
30 {
31 public:
32 
33  typedef std::map<DtUUID,double> AgingMap;
34  typedef std::map<DtUUID,DtWeaponList> WeaponsMap;
35 
36 public:
37 
41  DtLocalObject* owner,
42  DtSimulationServices* simServices,
43  DtComponentDescriptor* desc = 0,
44  DtReaderWriterRegistry* parentRegistry = 0);
45 
48 
51  virtual void addWeaponsList(const DtUUID& sub, const DtWeaponList& weapons);
52  virtual void removeWeaponsList(const DtUUID& sub);
54 
56  virtual void ageResponses();
57 
59  virtual void emptyWeaponsMap();
60 
62  virtual bool init();
63 
66  virtual const char* type() const;
67 
69  virtual bool postAddComponentsInit();
70 
72  virtual void preFirstTickInit();
73 
76 
77  virtual void processSubordinateAdded(const DtUUID& sub);
78  virtual void processSubordinateRemoved(const DtUUID& sub);
79 
82  virtual void sendWeaponResponse(const DtUUID& recipient, bool bIncludeResources);
83  virtual void sendResponsesToRequestors();
85 
87  virtual void tick();
92 
95 
96  static void weaponListRequestCallback(const DtVrfObjectMessage* msg, void* usr);
97  virtual void processWeaponListRequest(const DtVrfObjectMessage* msg);
99 
101 
102  static void weaponListResponseCallback(const DtVrfObjectMessage* msg, void* usr);
103  virtual void processWeaponResponse(const DtVrfObjectMessage* msg);
105 
109  static DtSimComponent * creator(const DtString& name,
110  DtLocalObject* owner,
111  DtSimulationServices* simManager,
112  DtComponentDescriptor* desc = 0,
113  DtReaderWriterRegistry* parentRegistry = 0);
114 
115 protected:
116 
126  const DtString& defaultPsrName, bool useDescriptorParams = true);
127 
130 
133 
136  orig);
137 
140  virtual void connectToWeaponListResponses();
141  virtual void disconnectFromWeaponListResponses();
143 
146  virtual void sendWeaponListRequest(const DtUUID& subId);
147  virtual void sendWeaponListRequests();
149 
150 protected:
155 
156  boost::signals2::scoped_connection mySubordinateAddedConnection;
157  boost::signals2::scoped_connection mySubordinateRemovedConnection;
158 
161 
164 
166 
169 
171 
172 };
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
std::map< DtUUID, double > AgingMap
Definition: aggregateWeaponListResponder.h:33
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual bool postAddComponentsInit()
Called after all components have been created, initialized and added to the component manager...
Definition: simComponent.h:107
AgingMap mySubordinateRequestAgingMap
Definition: aggregateWeaponListResponder.h:167
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
DtAggregateLocalObjectFacade myAggregateLocalObjectFacade
Definition: aggregateWeaponListResponder.h:165
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 init()
Calls createPorts and createPortGroups Initializes myLastTickSimTime.
boost::signals2::scoped_connection mySubordinateAddedConnection
Container for state data associated with this component. This state is saved and restored as part o...
Definition: aggregateWeaponListResponder.h:156
DtAggregateWeaponListResponder responds to DtWeaponListRequestAdmin.
Definition: aggregateWeaponListResponder.h:29
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
bool bMyPushToSuperior
Definition: aggregateWeaponListResponder.h:160
bool bMySendWeaponRequestToSubordinates
Definition: aggregateWeaponListResponder.h:159
DtTime myNextSendWeaponRequestTime
Definition: aggregateWeaponListResponder.h:162
DtSimComponent & operator=(const DtSimComponent &orig)
assignment operator, not implemented
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
DtVrfProcessStateRepository * createComponentPsr(const DtString &defaultPsrType, const DtString &defaultPsrName, bool useDescriptorParams=true)
Creates a PSR for this component and registers it with the PSR manager. This is typeically called fro...
std::list< WeaponSystem > DtWeaponList
Definition: weaponListResponseAdmin.h:43
WeaponsMap myWeaponsMap
Definition: aggregateWeaponListResponder.h:170
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
Class DtVrfProcessStateRepository: Abstract base class for all process state repositories. Process state repositories represent (potentially) shared, savable information for one or more components functioning together to achieve some process or set of processes; such as aiming and firing a weapon; moving an object; or just waiting a specified amount of time.
Definition: vrfProcessStateRepository.h:45
Contains the DtSimComponent class declaration.
std::map< DtUUID, DtWeaponList > WeaponsMap
Definition: aggregateWeaponListResponder.h:34
boost::signals2::scoped_connection mySubordinateRemovedConnection
Definition: aggregateWeaponListResponder.h:157
AgingMap myRequestorsAgingMap
Definition: aggregateWeaponListResponder.h:168
DtTime myNextAgingTime
Definition: aggregateWeaponListResponder.h:163
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)