VR-Forces 4.10 Class Documentation
 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 
9 #include <list>
10 #include <map>
11 #include <string>
12 
13 #include <matrix/vlVector.h>
14 
15 class DtVrfObject;
16 class DtSimManager;
19 class DtString;
20 class DtSimComponent;
24 class DtReaderWriter;
25 class DtCriticalSection;
26 class DtSimComponentList;
27 
28 typedef DtReaderWriter* (*genericAttributeProviderFunctionType)(void*);
30 
36 {
37 private:
39 
42  DtComponentSystem& operator=(const DtComponentSystem& orig);
44 
45 public:
47  DtSimManager* 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(DtString & attributeName,
205  genericAttributeProviderFunctionType attributeFunction,
206  void* controller);
207 
212  virtual bool addAttributeSetFunction(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 };
291 
292 typedef std::list<DtComponentSystem*> DtComponentSystemList;
std::list< std::pair< DtSimComponent *, DtString > > DtComponentPortList
Definition: componentSystem.h:142
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtComponentSystem * myParentSystem
Definition: componentSystem.h:267
A set of DtSimComponent and DtComponentSystem instances that are connected with a set of connections...
Definition: simComponentNetwork.h:33
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:47
DtComponentSystemPSR * myProcessStateRepository
Definition: componentSystem.h:266
bool myUseParentSystemResourceManager
If this is true uses the paren system&#39;s resource manager.
Definition: componentSystem.h:289
DtReaderWriter *(* genericAttributeProviderFunctionType)(void *)
Definition: componentSystem.h:28
std::list< DtComponentSystem * > DtComponentSystemList
Definition: componentSystem.h:292
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:42
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
DtSimManager * mySimManager
Definition: componentSystem.h:263
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
*array controller(no time code)*/template< class Instance
//!//!//!//!//!//!//!//!//!//!//!//
Definition: asyncJobServer.h:39
DtSimComponentNetwork * myComponentNetwork
Definition: componentSystem.h:265
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
Descriptor for a DtComponentSystem.
Definition: componentSystemDescriptor.h:23
DtComponentSystemPSR.
Definition: componentSystemPSR.h:26
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
RAII manager object for accessing paralle tick functionality.
Definition: parallelTickManager.h:324
const DtComponentSystemDescriptor * mySystemDescriptor
Definition: componentSystem.h:262
DtString myPrintName
A customized print name, if one was specified.
Definition: componentSystem.h:271
DtVrfObject * myVrfObject
Definition: componentSystem.h:264

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)