VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
componentSystem.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 #include <boost/signals2.hpp>
11 #include <list>
12 #include <map>
13 #include <string>
14 
15 #include <matrix/vlVector.h>
16 
20 class DtString;
21 class DtSimComponent;
24 class DtReaderWriter;
25 class DtSimComponentList;
26 class DtLocalObject;
27 
28 typedef DtReaderWriter* (*genericAttributeProviderFunctionType)(void*);
30 
36 {
37 private:
39 
42  DtComponentSystem& operator=(const DtComponentSystem& orig);
44 
45 public:
47  DtSimulationServices* simManager,
48  const DtComponentSystemDescriptor* desc,
49  DtComponentSystem* parentSystem);
50 
51  virtual ~DtComponentSystem();
52 
53  virtual bool init();
54 
61  virtual bool initializeFromDescriptor(int& priority, bool remoteOnly);
62 
64  virtual bool postAddComponentsInit();
65 
67  virtual void tick();
68 
71  virtual DtString name() const;
72 
76  virtual DtString fullName() const;
77 
79  virtual DtString systemName() const;
80 
83  virtual DtString printName() const;
84 
90  virtual void setPrintName(const DtString& name);
91 
93 
94  virtual DtSimComponentNetwork* componentNetwork();
95  virtual const DtSimComponentNetwork* componentNetwork() const;
97 
102  virtual DtComponentSystem* lookupSystem(const DtString& printName);
103 
110  virtual DtComponentSystem* lookupSystemFromRwName(const DtString& rwName);
111 
118  virtual DtComponentSystem* lookupSystemFromFullName(const DtString& fullName);
119 
122  virtual void getSystemNames(std::list<std::string>& nameList) const;
123 
126 
129  virtual DtVrfProcessStateRepositoryManager* processStateRepositoryManager();
130 
131  typedef std::list< std::pair<DtSimComponent*, DtString> > DtComponentPortList;
132 
133 
142 
143  virtual void resolveSystemOutput(const DtString& outputName, DtComponentPortList& componentOutputs);
144 
145  virtual void resolveSystemInput(const DtString& inputName, DtComponentPortList& componentInputs);
147 
148 
149 
151 
152  virtual void enable();
153  virtual void disable();
155 
159  virtual bool isEnabled() const;
160  virtual void setIsEnabled(bool yesNo);
162 
165  virtual bool canBeDisabled() const;
167 
169  virtual bool isDamaged() const;
170 
172  virtual void refreshDamageState();
173 
175  virtual DtHitZoneId hitZoneId() const;
176 
202  virtual bool addAttributeProviderFunction(const DtString & attributeName,
203  genericAttributeProviderFunctionType attributeFunction,
204  void* controller);
205 
210  virtual bool addAttributeSetFunction(const DtString& attributeName,
211  genericAttributeSetterFunctionType attributeFunction,
212  void* controller);
213 
222  virtual DtReaderWriter* getAttribute(const DtString& attributeName,
223  bool& error) const;
224 
232  virtual bool setAttribute(const DtString& attributeName,
233  DtReaderWriter* value);
234 
237  virtual std::list<std::string> getAllAttributeNames() const;
239 
241  virtual DtComponentSystemPSR* processStateRepository();
242 
243  virtual void updateImgui();
244 
247  virtual void upgradeFromImport();
248 
249  mutable boost::signals2::signal<void ()> signal_destroyed;
250 protected:
252  virtual bool createPsr();
253 
255  void removeCompatibilityPsrs();
256 
258  virtual void restore(DtSimComponentList*);
259 
260 protected:
267 
271 
273  std::map<DtString, std::pair<genericAttributeProviderFunctionType, void*> >
275  std::map<DtString, std::pair<genericAttributeSetterFunctionType, void*> >
277 
279  std::list< std::pair<DtString, DtVrfProcessStateRepositoryManager*> >
281 
283 };
284 
285 typedef std::list<DtComponentSystem*> DtComponentSystemList;
std::list< std::pair< DtSimComponent *, DtString > > DtComponentPortList
Definition: componentSystem.h:131
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: componentSystem.h:282
DtComponentSystem * myParentSystem
Definition: componentSystem.h:266
A set of DtSimComponent and DtComponentSystem instances that are connected with a set of connections...
Definition: simComponentNetwork.h:34
A DtComponentSystem is a collection of DtSimComponents that are associated with each other...
Definition: componentSystem.h:35
Definition: readerWriter.h:85
class DtVrfProcessStateRepositoryManager:
Definition: vrfProcessStateRepositoryManager.h:48
DtComponentSystemPSR * myProcessStateRepository
Definition: componentSystem.h:265
DtReaderWriter *(* genericAttributeProviderFunctionType)(void *)
Definition: componentSystem.h:28
std::list< DtComponentSystem * > DtComponentSystemList
Definition: componentSystem.h:285
std::map< DtString, std::pair< genericAttributeProviderFunctionType, void * > > myReadableAttributes
Map of attribute-names to provider-functions.
Definition: componentSystem.h:274
Class Description: DtSimComponentList.
Definition: simComponentList.h:28
boost::signals2::signal< void()> signal_destroyed
Definition: componentSystem.h:249
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
ID value for a hit zone. Consists of a zone function (weapon, sensor, movement, etc.) and a zone number. Includes functions for packing/unpacking into an int.
Definition: hitZoneId.h:21
bool(* genericAttributeSetterFunctionType)(void *, DtReaderWriter *)
Definition: componentSystem.h:29
std::map< DtString, std::pair< genericAttributeSetterFunctionType, void * > > myWritableAttributes
Definition: componentSystem.h:276
std::list< std::pair< DtString, DtVrfProcessStateRepositoryManager * > > myAddedCompatibilityPsrs
This list is kept so the compatibility PSRs can be removed upon destruction.
Definition: componentSystem.h:280
Definition: asyncJobServer.h:39
DtSimComponentNetwork * myComponentNetwork
Definition: componentSystem.h:264
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:97
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
Descriptor for a DtComponentSystem. Specified a system being added to an entity. This does not actual...
Definition: componentSystemDescriptor.h:25
DtComponentSystemPSR.
Definition: componentSystemPSR.h:21
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtSimulationServices * mySimManager
Definition: componentSystem.h:262
const DtComponentSystemDescriptor * mySystemDescriptor
Definition: componentSystem.h:261
DtLocalObject * myVrfObject
Definition: componentSystem.h:263
A locally simulated VRF object.
Definition: localObject.h:98
DtString myPrintName
A customized print name, if one was specified. Initialized by a component, or defaults to print name ...
Definition: componentSystem.h:270

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)