VR-Forces 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 
13 
14 class DtSimComponent;
15 class DtSimComponentList;
19 class DtPortConnection;
24 class DtSimMessage;
25 class DtLocalObject;
26 class DtVrfObjectMessage;
27 
32 {
33 private:
35 
38  const DtSimComponentManager & operator=(const DtSimComponentManager &
39  orig);
41 
42 public:
43 
46 
48  virtual ~DtSimComponentManager();
49 
50  virtual bool init();
51 
52  virtual void tick();
53 
56  virtual DtLocalObject* vrfObject() const;
57 
58  virtual bool addComponents();
59 
60  virtual bool addSensorComponent(DtSimComponent * component);
61  virtual bool addControllerComponent(DtSimComponent * component);
62  virtual bool addActuatorComponent(DtSimComponent * component);
63 
67  virtual bool removeSensorComponent(DtSimComponent * component);
71  virtual bool removeControllerComponent(DtSimComponent * component);
75  virtual bool removeActuatorComponent(DtSimComponent * component);
76 
78  virtual bool hasComponents() const;
79 
82  virtual std::list<DtSimComponent*> lookupComponentsByType(const DtString& typeString) const;
83 
85  template <typename T_ComponentType>
86  std::list<DtSimComponent*> lookupComponentsByDynamicCast() const
87  {
88  return myComponentSystem->componentNetwork()->lookupComponentsByDynamicCast<T_ComponentType>();
89  }
90 
97  virtual DtSimComponent * lookupComponent(const DtString& name) const;
98 
107  virtual DtComponentSystem* lookupSystem(const std::string& printName);
108  virtual const DtComponentSystem* lookupSystem(const std::string& printName) const;
109 
114  virtual DtComponentSystem* lookupSystemFromFullName(const std::string& fullName);
115 
116 
120  virtual void setAllSystemEnabled(bool enableDisable);
121 
123  virtual void setSystemEnabled(const std::string& systemName, bool enableDisable, bool sendSystemUpdate);
124 
126  virtual std::list<std::string> getSystemNames() const;
127 
132  virtual DtString systemCategory(DtString& systemName) const;
133 
134  virtual DtSimComponentList * sensorComponentList() const;
135  virtual DtControllerComponentList * controllerComponentList() const;
136  virtual DtSimComponentList * actuatorComponentList() const;
137 
140 
141  virtual DtComponentSystem* baseSystem();
142  virtual const DtComponentSystem* baseSystem() const;
144 
147  virtual DtString type() const;
148 
149  virtual DtList* connectionList();
150  virtual DtList* groupConnectionList();
151 
156  static DtSimComponentManagerFactory * factory();
157  static void setFactory(DtSimComponentManagerFactory * factory);
158 
159  static void addSimComponentManagerCreatorFcn(const DtString & type,
161 
162  static DtSimComponentManager * creator(DtLocalObject * vrfObject);
163 
165  static DtSimComponentManager * createComponentManager(const DtString & type,
166  DtLocalObject* vrfObject);
167 
170  virtual void allSystems(DtComponentSystemList&) const;
171 
173  virtual bool hasSystemThatCanBeDisabled();
174 
177 
178  static void systemListRequestCallback(const DtVrfObjectMessage* msg, void* usr);
179  virtual void processSystemListRequest(const DtVrfObjectMessage* msg);
181 
184 
185  static void genericSetRwRequestCallback(const DtVrfObjectMessage* msg, void* usr);
186  virtual void processGenericSetRwRequest(const DtVrfObjectMessage* msg);
188 
189  static void notifySetDataSubscriberCallback(DtSimMessage * msg, void * usr);
190  virtual void notifySetDataSubscriber(DtSimMessage * msg);
191  virtual void sendGenericSetRwStateSubscribersUpdate(const DtSetMessageType& type, const DtUUID& uuid = DtUUID::nullUUID());
192 
194  virtual void sendSystemStateUpdated(const std::vector<DtComponentSystem*>& system);
195  virtual void sendSystemStateUpdated(DtComponentSystem* system);
196 
197  virtual void updateImgui();
198 protected:
201  virtual void allSystems(DtComponentSystemList&, DtComponentSystem*) const;
202 
203 
204 protected:
207 
210  std::set<DtUUID> mySystemStateSubscribers;
211  std::map< DtString, std::set< DtUUID > > myGenericSetRwStateSubscribers;
213 };
DtList myGroupConnectionList
Definition: simComponentManager.h:209
UUID is a unique ID wrapper class.
Definition: uuid.h:59
Class Description: DtControllerComponentList.
Definition: controllerComponentList.h:38
DtComponentSystem * myComponentSystem
Definition: simComponentManager.h:206
DtSimComponentManager *(* DtSimComponentManagerCreatorFcn)(DtLocalObject *vrfObject)
Definition: simComponentManagerFactory.h:16
DtLocalObject * myVrfObject
Definition: simComponentManager.h:205
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:211
Instances of DtComponentDescriptorList are readable/writeable lists of DtComponentDescriptor objects...
Definition: componentDescriptorList.h:22
std::list< DtComponentSystem * > DtComponentSystemList
Definition: componentSystem.h:272
Class Description: DtSimComponentList.
Definition: simComponentList.h:28
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:210
The DtSimComponentManager is the top level class within a DtSimObject which owns and manages all the ...
Definition: simComponentManager.h:31
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
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:212
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
Definition: portGroupConnection.h:25
class DtSimComponentManagerFactory:
Definition: simComponentManagerFactory.h:24
std::list< DtSimComponent * > lookupComponentsByDynamicCast() const
Returns a list of DtSimComponents that can cast to the particular component type. ...
Definition: simComponentManager.h:86
DtList myConnectionList
Definition: simComponentManager.h:208
A locally simulated VRF object.
Definition: localObject.h:98

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)