VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtSimComponentNetwork Class Reference

A set of DtSimComponent and DtComponentSystem instances that are connected with a set of connections. This class manages the instantiation of these components and systems from the descriptors and connecting them based on the connection list provided.

Public Member Functions

 DtSimComponentNetwork (DtLocalObject *vrfObject, DtComponentSystem *parentSystem)
 
virtual ~DtSimComponentNetwork ()
 
virtual bool init ()
 
virtual void tick (bool hostDestroyed)
 
virtual bool postAddComponentsInit ()
 
virtual bool addSensorComponent (DtSimComponent *component)
 
virtual bool addControllerComponent (DtSimComponent *component)
 
virtual bool addActuatorComponent (DtSimComponent *component)
 
virtual bool removeSensorComponent (DtSimComponent *component)
 
virtual bool removeControllerComponent (DtSimComponent *component)
 
virtual bool removeActuatorComponent (DtSimComponent *component)
 
virtual DtSimComponent * lookupComponent (const DtString &name) const
 
virtual std::list
< DtSimComponent * > 
lookupComponentsByType (const DtString &typeString)
 
template<typename T_ComponentType >
std::list< DtSimComponent * > lookupComponentsByDynamicCast () const
 
virtual DtComponentSystem * lookupComponentSystem (const DtString &name) const
 
virtual const
DtComponentSystemList * 
componentSystemList () const
 
virtual DtSimComponentList * sensorComponentList () const
 
virtual DtControllerComponentList * controllerComponentList () const
 
virtual DtSimComponentList * actuatorComponentList () const
 
virtual int createComponentsFromList (const DtComponentDescriptorList &descList, DtSimComponentList *destination, int &priority, bool remoteOnly)
 
virtual int createSystemsFromList (const DtComponentSystemDescriptorList &descList, int &priority, bool remoteOnly)
 
virtual bool createComponentConnection (const DtString &source, const DtString &destination, int warningLevel=1)
 
virtual void createConnectionsFromList (const DtConnectionDescriptorList &descList, bool suppressErrorMsgs=false)
 
virtual void disconnectComponent (DtSimComponent *component)
 
virtual void removeConnection (DtPortConnection *conn)
 
virtual void removeConnection (DtPortGroupConnection *conn)
 
virtual void clear ()
 
virtual void updateImgui ()
 
virtual void enable ()
 
virtual void disable ()
 

Protected Member Functions

virtual bool createComponentConnection (DtSimComponent *sourceComp, const DtString &sourcePortName, DtSimComponent *destComponent, const DtString &destPortName, DtString &errorString)
 
virtual bool createSensorComponentList ()
 
virtual bool createControllerComponentList ()
 
virtual bool createActuatorComponentList ()
 

Protected Attributes

DtSimComponentList * mySensorComponentList
 
DtControllerComponentList * myControllerComponentList
 
DtSimComponentList * myActuatorComponentList
 
DtComponentSystemList mySystemList
 
DtLocalObject * myVrfObject
 
DtComponentSystem * myParentSystem
 

Private Member Functions

 DtSimComponentNetwork ()
 
 DtSimComponentNetwork (const DtSimComponentNetwork &orig)
 
DtSimComponentNetwork & operator= (const DtSimComponentNetwork &orig)
 

Constructor & Destructor Documentation

DtSimComponentNetwork::DtSimComponentNetwork ( )
private

Not implemented.

DtSimComponentNetwork::DtSimComponentNetwork ( const DtSimComponentNetwork &  orig)
private

Not implemented.

DtSimComponentNetwork::DtSimComponentNetwork ( DtLocalObject *  vrfObject,
DtComponentSystem *  parentSystem 
)
virtual DtSimComponentNetwork::~DtSimComponentNetwork ( )
virtual

Member Function Documentation

DtSimComponentNetwork& DtSimComponentNetwork::operator= ( const DtSimComponentNetwork &  orig)
private

Not implemented.

virtual bool DtSimComponentNetwork::init ( )
virtual
virtual void DtSimComponentNetwork::tick ( bool  hostDestroyed)
virtual
virtual bool DtSimComponentNetwork::postAddComponentsInit ( )
virtual

Calls postAddComponentsInit() on all subcomponents.

virtual bool DtSimComponentNetwork::addSensorComponent ( DtSimComponent *  component)
virtual
virtual bool DtSimComponentNetwork::addControllerComponent ( DtSimComponent *  component)
virtual
virtual bool DtSimComponentNetwork::addActuatorComponent ( DtSimComponent *  component)
virtual
virtual bool DtSimComponentNetwork::removeSensorComponent ( DtSimComponent *  component)
virtual

Removes sensor from the component manager list, and removes any port connections to or from the component by calling disconnectComponent(). Does not delete the component.

virtual bool DtSimComponentNetwork::removeControllerComponent ( DtSimComponent *  component)
virtual

Removes controller from the component manager list, and removes any port connections to or from the component by calling disconnectComponent(). Does not delete the component.

virtual bool DtSimComponentNetwork::removeActuatorComponent ( DtSimComponent *  component)
virtual

Removes actuator from the component manager list, and removes any port connections to or from the component by calling disconnectComponent(). Does not delete the component.

virtual DtSimComponent* DtSimComponentNetwork::lookupComponent ( const DtString &  name) const
virtual

Lookup a particular component by its DtReaderWriter name. This recurses down though all component systems contained by this network.

virtual std::list<DtSimComponent*> DtSimComponentNetwork::lookupComponentsByType ( const DtString &  typeString)
virtual

Returns a list of all components of the given type in this component network. The typeString is that returned by DtSimComponent::type() such as those found in compTypes.h.

template<typename T_ComponentType >
std::list<DtSimComponent*> DtSimComponentNetwork::lookupComponentsByDynamicCast ( ) const
inline

Returns a list of DtSimComponents that can cast to the particular component type.

virtual DtComponentSystem* DtSimComponentNetwork::lookupComponentSystem ( const DtString &  name) const
virtual

Lookup a particular system by name.

virtual const DtComponentSystemList* DtSimComponentNetwork::componentSystemList ( ) const
virtual
virtual DtSimComponentList* DtSimComponentNetwork::sensorComponentList ( ) const
virtual
virtual DtControllerComponentList* DtSimComponentNetwork::controllerComponentList ( ) const
virtual
virtual DtSimComponentList* DtSimComponentNetwork::actuatorComponentList ( ) const
virtual
virtual int DtSimComponentNetwork::createComponentsFromList ( const DtComponentDescriptorList &  descList,
DtSimComponentList *  destination,
int &  priority,
bool  remoteOnly 
)
virtual
Returns
The number of components created.
virtual int DtSimComponentNetwork::createSystemsFromList ( const DtComponentSystemDescriptorList &  descList,
int &  priority,
bool  remoteOnly 
)
virtual

Populates mySystemList by creating the systems described in the provided system descriptor list. If any systems have duplicate names they will not be created and a warning will be printed.

Parameters
priorityThe starting priority of any components that are created by this call. This parameter will contain the next valid priority for creation of components created after this call.
Returns
The number of systems created.
virtual bool DtSimComponentNetwork::createComponentConnection ( const DtString &  source,
const DtString &  destination,
int  warningLevel = 1 
)
virtual

Adds a new port connection between two components within the component manager. Source and Destination strings are specified in any of the formats: component-name:port-name component-name:port-group-name component-name:port-group-name:port-name A connection between two port groups will create connections between all members of the two groups which have matching names and types.

Warning level is 0 produce no warning, 1 produce error level, 2 produce verbose level. 2 will be set for auto-connections

virtual void DtSimComponentNetwork::createConnectionsFromList ( const DtConnectionDescriptorList &  descList,
bool  suppressErrorMsgs = false 
)
virtual

Takes the connection descriptor list from the OPD file and creates all the port connection and port group connections for this entity. Makes the connections by calling createComponentConnection().

virtual void DtSimComponentNetwork::disconnectComponent ( DtSimComponent *  component)
virtual

Removes and deletes all connections (both port and port group) to and from this component.

virtual void DtSimComponentNetwork::removeConnection ( DtPortConnection *  conn)
virtual

Removes and deletes a single connection.

virtual void DtSimComponentNetwork::removeConnection ( DtPortGroupConnection *  conn)
virtual

Removes and deletes a group connection and any sub-connections that are part of the group.

virtual void DtSimComponentNetwork::enable ( )
virtual

Enables/disables components/systems in the network.

virtual void DtSimComponentNetwork::disable ( )
virtual

Enables/disables components/systems in the network.

virtual void DtSimComponentNetwork::clear ( )
virtual

Clears out all information and deletes all components in this network.

virtual void DtSimComponentNetwork::updateImgui ( )
virtual
virtual bool DtSimComponentNetwork::createComponentConnection ( DtSimComponent *  sourceComp,
const DtString &  sourcePortName,
DtSimComponent *  destComponent,
const DtString &  destPortName,
DtString &  errorString 
)
protectedvirtual

Locates the named ports on each specified component and creates a connection between them. If unable to create, the error is returned in errorString, and the function returns false.

virtual bool DtSimComponentNetwork::createSensorComponentList ( )
protectedvirtual
virtual bool DtSimComponentNetwork::createControllerComponentList ( )
protectedvirtual
virtual bool DtSimComponentNetwork::createActuatorComponentList ( )
protectedvirtual

Member Data Documentation

DtSimComponentList* DtSimComponentNetwork::mySensorComponentList
protected
DtControllerComponentList* DtSimComponentNetwork::myControllerComponentList
protected
DtSimComponentList* DtSimComponentNetwork::myActuatorComponentList
protected
DtComponentSystemList DtSimComponentNetwork::mySystemList
protected
DtLocalObject* DtSimComponentNetwork::myVrfObject
protected
DtComponentSystem* DtSimComponentNetwork::myParentSystem
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)