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 
193  virtual bool addAttributeProviderFunction(const DtString & attributeName,
194  genericAttributeProviderFunctionType attributeFunction,
195  void* controller);
196 
201  virtual bool addAttributeSetFunction(const DtString& attributeName,
202  genericAttributeSetterFunctionType attributeFunction,
203  void* controller);
204 
213  virtual DtReaderWriter* getAttribute(const DtString& attributeName,
214  bool& error) const;
215 
223  virtual bool setAttribute(const DtString& attributeName,
224  DtReaderWriter* value);
225 
228  virtual std::list<std::string> getAllAttributeNames() const;
230 
232  virtual DtComponentSystemPSR* processStateRepository();
233 
234  virtual void updateImgui();
235 
236  mutable boost::signals2::signal<void ()> signal_destroyed;
237 protected:
239  virtual bool createPsr();
240 
242  void removeCompatibilityPsrs();
243 
245  virtual void restore(DtSimComponentList*);
246 
247 protected:
254 
258 
260  std::map<DtString, std::pair<genericAttributeProviderFunctionType, void*> >
262  std::map<DtString, std::pair<genericAttributeSetterFunctionType, void*> >
264 
266  std::list< std::pair<DtString, DtVrfProcessStateRepositoryManager*> >
268 
270 };
271 
272 typedef std::list<DtComponentSystem*> DtComponentSystemList;
std::list< std::pair< DtSimComponent *, DtString > > DtComponentPortList
Definition: componentSystem.h:131
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: componentSystem.h:269
DtComponentSystem * myParentSystem
Definition: componentSystem.h:253
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:49
DtComponentSystemPSR * myProcessStateRepository
Definition: componentSystem.h:252
DtReaderWriter *(* genericAttributeProviderFunctionType)(void *)
Definition: componentSystem.h:28
std::list< DtComponentSystem * > DtComponentSystemList
Definition: componentSystem.h:272
std::map< DtString, std::pair< genericAttributeProviderFunctionType, void * > > myReadableAttributes
Map of attribute-names to provider-functions.
Definition: componentSystem.h:261
Class Description: DtSimComponentList.
Definition: simComponentList.h:28
boost::signals2::signal< void()> signal_destroyed
Definition: componentSystem.h:236
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
bool(* genericAttributeSetterFunctionType)(void *, DtReaderWriter *)
Definition: componentSystem.h:29
std::map< DtString, std::pair< genericAttributeSetterFunctionType, void * > > myWritableAttributes
Definition: componentSystem.h:263
std::list< std::pair< DtString, DtVrfProcessStateRepositoryManager * > > myAddedCompatibilityPsrs
This list is kept so the compatibility PSRs can be removed upon destruction.
Definition: componentSystem.h:267
Definition: asyncJobServer.h:39
DtSimComponentNetwork * myComponentNetwork
Definition: componentSystem.h:251
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
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:23
DtComponentSystemPSR.
Definition: componentSystemPSR.h:21
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtSimulationServices * mySimManager
Definition: componentSystem.h:249
const DtComponentSystemDescriptor * mySystemDescriptor
Definition: componentSystem.h:248
DtLocalObject * myVrfObject
Definition: componentSystem.h:250
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:257

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)