VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simComponentManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
12 
13 class DtSimComponent;
14 class DtSimComponentList;
18 class DtPortConnection;
23 class DtSimMessage;
24 class DtLocalObject;
25 class DtVrfObjectMessage;
26 
31 {
32 private:
34 
37  const DtSimComponentManager & operator=(const DtSimComponentManager &
38  orig);
40 
41 public:
42 
45 
47  virtual ~DtSimComponentManager();
48 
49  virtual bool init();
50 
51  virtual void tick();
52 
55  virtual DtLocalObject* vrfObject() const;
56 
57  virtual bool addComponents();
58 
59  virtual bool addSensorComponent(DtSimComponent * component);
60  virtual bool addControllerComponent(DtSimComponent * component);
61  virtual bool addActuatorComponent(DtSimComponent * component);
62 
66  virtual bool removeSensorComponent(DtSimComponent * component);
70  virtual bool removeControllerComponent(DtSimComponent * component);
74  virtual bool removeActuatorComponent(DtSimComponent * component);
75 
77  virtual bool hasComponents() const;
78 
81  virtual std::list<DtSimComponent*> lookupComponentsByType(const DtString& typeString) const;
82 
89  virtual DtSimComponent * lookupComponent(const DtString& name) const;
90 
99  virtual DtComponentSystem* lookupSystem(const std::string& printName);
100  virtual const DtComponentSystem* lookupSystem(const std::string& printName) const;
101 
106  virtual DtComponentSystem* lookupSystemFromFullName(const std::string& fullName);
107 
108 
112  virtual void setAllSystemEnabled(bool enableDisable);
113 
115  virtual void setSystemEnabled(const std::string& systemName, bool enableDisable, bool sendSystemUpdate);
116 
118  virtual std::list<std::string> getSystemNames() const;
119 
124  virtual DtString systemCategory(DtString& systemName) const;
125 
126  virtual DtSimComponentList * sensorComponentList() const;
127  virtual DtControllerComponentList * controllerComponentList() const;
128  virtual DtSimComponentList * actuatorComponentList() const;
129 
132 
133  virtual DtComponentSystem* baseSystem();
134  virtual const DtComponentSystem* baseSystem() const;
136 
139  virtual DtString type() const;
140 
141  virtual DtList* connectionList();
142  virtual DtList* groupConnectionList();
143 
148  static DtSimComponentManagerFactory * factory();
149  static void setFactory(DtSimComponentManagerFactory * factory);
150 
151  static void addSimComponentManagerCreatorFcn(const DtString & type,
153 
154  static DtSimComponentManager * creator(DtLocalObject * vrfObject);
155 
157  static DtSimComponentManager * createComponentManager(const DtString & type,
158  DtLocalObject* vrfObject);
159 
162  virtual void allSystems(DtComponentSystemList&) const;
163 
165  virtual bool hasSystemThatCanBeDisabled();
166 
169 
170  static void systemListRequestCallback(const DtVrfObjectMessage* msg, void* usr);
171  virtual void processSystemListRequest(const DtVrfObjectMessage* msg);
173 
176 
177  static void genericSetRwRequestCallback(const DtVrfObjectMessage* msg, void* usr);
178  virtual void processGenericSetRwRequest(const DtVrfObjectMessage* msg);
180 
181  static void notifySetDataSubscriberCallback(DtSimMessage * msg, void * usr);
182  virtual void notifySetDataSubscriber(DtSimMessage * msg);
183  virtual void sendGenericSetRwStateSubscribersUpdate(const DtSetMessageType& type, const DtUUID& uuid = DtUUID::nullUUID());
184 
186  virtual void sendSystemStateUpdated(const std::vector<DtComponentSystem*>& system);
187  virtual void sendSystemStateUpdated(DtComponentSystem* system);
188 protected:
191  virtual void allSystems(DtComponentSystemList&, DtComponentSystem*) const;
192 
193 
194 protected:
197 
200  std::set<DtUUID> mySystemStateSubscribers;
201  std::map< DtString, std::set< DtUUID > > myGenericSetRwStateSubscribers;
203 };
DtList myGroupConnectionList
Definition: simComponentManager.h:199
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
Class Description: DtControllerComponentList.
Definition: controllerComponentList.h:38
DtComponentSystem * myComponentSystem
Definition: simComponentManager.h:196
DtSimComponentManager *(* DtSimComponentManagerCreatorFcn)(DtLocalObject *vrfObject)
Definition: simComponentManagerFactory.h:16
DtLocalObject * myVrfObject
Definition: simComponentManager.h:195
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
std::map< DtString, std::set< DtUUID > > myGenericSetRwStateSubscribers
Definition: simComponentManager.h:201
Instances of DtComponentDescriptorList are readable/writeable lists of DtComponentDescriptor objects...
Definition: componentDescriptorList.h:22
std::list< DtComponentSystem * > DtComponentSystemList
Definition: componentSystem.h:294
Class Description: DtSimComponentList.
Definition: simComponentList.h:39
static const DtUUID & nullUUID()
A DtPortConnection represents a connection between a DtOutputPort and a DtInputPort. PortConnections can be either active or inactive. An active connection is a connection which is supplying data, while an inactive connection is not currently supplying data. Data must be passed through connections as DtPortData.
Definition: portConnection.h:29
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
File: simMsg.h.
Definition: simMessage.h:35
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
Instances of DtConnectionDescriptorList are readable/writeable lists of DtConnectionDescriptor object...
Definition: connectionDescriptorList.h:22
std::set< DtUUID > mySystemStateSubscribers
Definition: simComponentManager.h:200
The DtSimComponentManager is the top level class within a DtSimObject which owns and manages all the ...
Definition: simComponentManager.h:30
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
Descriptor for a DtComponentSystem. Specified a system being added to an entity. This does not actual...
Definition: componentSystemDescriptor.h:23
Admin content for a message that requests the available system lists for an entity The expected respo...
Definition: systemListRequestAdmin.h:31
static DtSimComponentManagerFactory * theFactory
Definition: simComponentManager.h:202
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
Definition: portGroupConnection.h:25
class DtSimComponentManagerFactory:
Definition: simComponentManagerFactory.h:24
DtList myConnectionList
Definition: simComponentManager.h:198
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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)