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 <list>
11 #include <map>
12 #include <string>
13 
14 #include <matrix/vlVector.h>
15 
19 class DtString;
20 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 
133 
134  virtual DtSimResourceManager& resourceManager();
135  virtual const DtSimResourceManager& resourceManager() const;
137 
140  virtual void restoreResources();
141 
142  typedef std::list< std::pair<DtSimComponent*, DtString> > DtComponentPortList;
143 
144 
153 
154  virtual void resolveSystemOutput(const DtString& outputName, DtComponentPortList& componentOutputs);
155 
156  virtual void resolveSystemInput(const DtString& inputName, DtComponentPortList& componentInputs);
158 
159 
160 
162 
163  virtual void enable();
164  virtual void disable();
166 
170  virtual bool isEnabled() const;
171  virtual void setIsEnabled(bool yesNo);
173 
176  virtual bool canBeDisabled() const;
178 
204  virtual bool addAttributeProviderFunction(const DtString & attributeName,
205  genericAttributeProviderFunctionType attributeFunction,
206  void* controller);
207 
212  virtual bool addAttributeSetFunction(const DtString& attributeName,
213  genericAttributeSetterFunctionType attributeFunction,
214  void* controller);
215 
224  virtual DtReaderWriter* getAttribute(const DtString& attributeName,
225  bool& error) const;
226 
234  virtual bool setAttribute(const DtString& attributeName,
235  DtReaderWriter* value);
236 
239  virtual std::list<std::string> getAllAttributeNames() const;
241 
243  virtual DtComponentSystemPSR* processStateRepository();
244 
247  virtual void setUseParentSystemResourceManager(bool);
248  virtual bool useParentSystemResourceManager() const;
250 
251 protected:
253  virtual bool createPsr();
254 
256  void removeCompatibilityPsrs();
257 
259  virtual void restore(DtSimComponentList*);
260 
261 protected:
268 
272 
274  std::map<DtString, std::pair<genericAttributeProviderFunctionType, void*> >
276  std::map<DtString, std::pair<genericAttributeSetterFunctionType, void*> >
278 
280  std::list< std::pair<DtString, DtVrfProcessStateRepositoryManager*> >
282 
290 
292 };
293 
294 typedef std::list<DtComponentSystem*> DtComponentSystemList;
std::list< std::pair< DtSimComponent *, DtString > > DtComponentPortList
Definition: componentSystem.h:142
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: componentSystem.h:291
DtComponentSystem * myParentSystem
Definition: componentSystem.h:267
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 DtSimResourceManager:
Definition: simResourceManager.h:38
class DtVrfProcessStateRepositoryManager:
Definition: vrfProcessStateRepositoryManager.h:49
DtComponentSystemPSR * myProcessStateRepository
Definition: componentSystem.h:266
bool myUseParentSystemResourceManager
If this is true uses the paren system&#39;s resource manager. By default is false. This is done such that...
Definition: componentSystem.h:289
DtReaderWriter *(* genericAttributeProviderFunctionType)(void *)
Definition: componentSystem.h:28
std::list< DtComponentSystem * > DtComponentSystemList
Definition: componentSystem.h:294
std::map< DtString, std::pair< genericAttributeProviderFunctionType, void * > > myReadableAttributes
Map of attribute-names to provider-functions.
Definition: componentSystem.h:275
Class Description: DtSimComponentList.
Definition: simComponentList.h:39
#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:277
std::list< std::pair< DtString, DtVrfProcessStateRepositoryManager * > > myAddedCompatibilityPsrs
This list is kept so the compatibility PSRs can be removed upon destruction.
Definition: componentSystem.h:281
Definition: asyncJobServer.h:39
DtSimComponentNetwork * myComponentNetwork
Definition: componentSystem.h:265
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
Descriptor for a DtComponentSystem. Specified a system being added to an entity. This does not actual...
Definition: componentSystemDescriptor.h:23
DtComponentSystemPSR.
Definition: componentSystemPSR.h:26
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtSimulationServices * mySimManager
Definition: componentSystem.h:263
const DtComponentSystemDescriptor * mySystemDescriptor
Definition: componentSystem.h:262
DtLocalObject * myVrfObject
Definition: componentSystem.h:264
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
DtString myPrintName
A customized print name, if one was specified. Initialized by a component, or defaults to print name ...
Definition: componentSystem.h:271

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)