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

The DtSimComponentManager is the top level class within a DtSimObject which owns and manages all the DtSimComponent instances for that object. It does much of this management though a DtSimComponentNetwork.

Inheritance diagram for DtSimComponentManager:
Inheritance graph
[legend]

Public Member Functions

 DtSimComponentManager (DtLocalObject *vrfObject)
 
virtual ~DtSimComponentManager ()
 
virtual bool init ()
 
virtual void tick ()
 
virtual DtLocalObjectvrfObject () const
 
virtual bool addComponents ()
 
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 bool hasComponents () const
 
virtual std::list
< DtSimComponent * > 
lookupComponentsByType (const DtString &typeString) const
 
virtual DtSimComponentlookupComponent (const DtString &name) const
 
virtual DtComponentSystemlookupSystem (const std::string &printName)
 
virtual const DtComponentSystemlookupSystem (const std::string &printName) const
 
virtual DtComponentSystemlookupSystemFromFullName (const std::string &fullName)
 
virtual void setAllSystemEnabled (bool enableDisable)
 
virtual void setSystemEnabled (const std::string &systemName, bool enableDisable, bool sendSystemUpdate)
 
virtual std::list< std::string > getSystemNames () const
 
virtual DtString systemCategory (DtString &systemName) const
 
virtual DtSimComponentListsensorComponentList () const
 
virtual DtControllerComponentListcontrollerComponentList () const
 
virtual DtSimComponentListactuatorComponentList () const
 
virtual DtString type () const
 
virtual DtList * connectionList ()
 
virtual DtList * groupConnectionList ()
 
virtual void allSystems (DtComponentSystemList &) const
 
virtual bool hasSystemThatCanBeDisabled ()
 
virtual void notifySetDataSubscriber (DtSimMessage *msg)
 
virtual void sendGenericSetRwStateSubscribersUpdate (const DtSetMessageType &type, const DtUUID &uuid=DtUUID::nullUUID())
 
virtual void sendSystemStateUpdated (const std::vector< DtComponentSystem * > &system)
 
virtual void sendSystemStateUpdated (DtComponentSystem *system)
 
virtual DtComponentSystembaseSystem ()
 
virtual const DtComponentSystembaseSystem () const
 

Static Public Member Functions

static
DtSimComponentManagerFactory
factory ()
 
static void setFactory (DtSimComponentManagerFactory *factory)
 
static void addSimComponentManagerCreatorFcn (const DtString &type, DtSimComponentManagerCreatorFcn fcn)
 
static DtSimComponentManagercreator (DtLocalObject *vrfObject)
 
static DtSimComponentManagercreateComponentManager (const DtString &type, DtLocalObject *vrfObject)
 
static void notifySetDataSubscriberCallback (DtSimMessage *msg, void *usr)
 

Protected Member Functions

virtual void allSystems (DtComponentSystemList &, DtComponentSystem *) const
 

Protected Attributes

DtLocalObjectmyVrfObject
 
DtComponentSystemmyComponentSystem
 
DtList myConnectionList
 
DtList myGroupConnectionList
 
std::set< DtUUIDmySystemStateSubscribers
 
std::map< DtString, std::set
< DtUUID > > 
myGenericSetRwStateSubscribers
 

Static Protected Attributes

static
DtSimComponentManagerFactory
theFactory
 

Private Member Functions

 DtSimComponentManager ()
 
 DtSimComponentManager (const DtSimComponentManager &orig)
 
const DtSimComponentManageroperator= (const DtSimComponentManager &orig)
 
virtual void processSystemListRequest (const DtVrfObjectMessage *msg)
 
static void systemListRequestCallback (const DtVrfObjectMessage *msg, void *usr)
 
virtual void processGenericSetRwRequest (const DtVrfObjectMessage *msg)
 
static void genericSetRwRequestCallback (const DtVrfObjectMessage *msg, void *usr)
 

Constructor & Destructor Documentation

DtSimComponentManager::DtSimComponentManager ( )
private

Not implemented.

DtSimComponentManager::DtSimComponentManager ( const DtSimComponentManager orig)
private

Not implemented.

DtSimComponentManager::DtSimComponentManager ( DtLocalObject vrfObject)

read/writable constructor

virtual DtSimComponentManager::~DtSimComponentManager ( )
virtual

destructor

Member Function Documentation

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

Not implemented.

virtual bool DtSimComponentManager::init ( )
virtual
virtual void DtSimComponentManager::tick ( )
virtual
virtual DtLocalObject* DtSimComponentManager::vrfObject ( ) const
virtual

This is a pointer to the simulation object for which this interface was created.

virtual bool DtSimComponentManager::addComponents ( )
virtual

Reimplemented in DtRemoteComponentManager.

virtual bool DtSimComponentManager::addSensorComponent ( DtSimComponent component)
virtual
virtual bool DtSimComponentManager::addControllerComponent ( DtSimComponent component)
virtual
virtual bool DtSimComponentManager::addActuatorComponent ( DtSimComponent component)
virtual
virtual bool DtSimComponentManager::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 DtSimComponentManager::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 DtSimComponentManager::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 bool DtSimComponentManager::hasComponents ( ) const
virtual

Returns true if this object has components or systems, false otherwise.

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

Returns a list of DtSimComponents that have the specified type. The typeString is that returned by DtSimComponent::type() such as those found in compTypes.h.

virtual DtSimComponent* DtSimComponentManager::lookupComponent ( const DtString name) const
virtual

Lookup a particular component by its DtReaderWriter name. It will search all systems on the entity.

Returns
The first component matching the given name
Note
Because this searches all systems on the entity, it is possible for there to be multiple components with the same name. The first one encountered in the search will be returned.
virtual DtComponentSystem* DtSimComponentManager::lookupSystem ( const std::string &  printName)
virtual

Look up a system by its name. It first looks through all systems, searching depth-first, checking their print names. If no matching systems are found, it searches through all systems again, checking against the RW system name. This function uses a std::string argument to support script interfaces directly.

Returns
The first system found with this name. If none are found, returns NULL.
virtual const DtComponentSystem* DtSimComponentManager::lookupSystem ( const std::string &  printName) const
virtual
virtual DtComponentSystem* DtSimComponentManager::lookupSystemFromFullName ( const std::string &  fullName)
virtual

  Look up a system by its full name. It first looks through all systems,

searching depth-first, checking their full names.

Returns
The first system found with this name. If none are found, returns NULL.
virtual void DtSimComponentManager::setAllSystemEnabled ( bool  enableDisable)
virtual

Performs a lookup and attempts to enable or disable all systems. if true is passed in (enable) it will iterate over all systems that are currently disabled. if false is passed in, it will iterate over all systems that can be disabled and are currently enabled.

virtual void DtSimComponentManager::setSystemEnabled ( const std::string &  systemName,
bool  enableDisable,
bool  sendSystemUpdate 
)
virtual

Performs a lookup and attempts to enable or disable the given system.

virtual std::list<std::string> DtSimComponentManager::getSystemNames ( ) const
virtual

Get a list of all system (print) names.

virtual DtString DtSimComponentManager::systemCategory ( DtString systemName) const
virtual

Get the category of a system, i.e. system name at the first level under the base; e.g. sensor, weapon, weapon-1, damage, other, etc. SystemName is the display name of the system (i.e., what is returned from getSystemNames).

virtual DtSimComponentList* DtSimComponentManager::sensorComponentList ( ) const
virtual
virtual DtControllerComponentList* DtSimComponentManager::controllerComponentList ( ) const
virtual
virtual DtSimComponentList* DtSimComponentManager::actuatorComponentList ( ) const
virtual
virtual DtComponentSystem* DtSimComponentManager::baseSystem ( )
virtual
Returns
A pointer to the base system of this entity. This system contains all components and other systems of this entity.
virtual const DtComponentSystem* DtSimComponentManager::baseSystem ( ) const
virtual
Returns
A pointer to the base system of this entity. This system contains all components and other systems of this entity.
virtual DtString DtSimComponentManager::type ( ) const
virtual

Returns the type of component manager object. Strings are defined in compMgrTypes.h.

virtual DtList* DtSimComponentManager::connectionList ( )
virtual
virtual DtList* DtSimComponentManager::groupConnectionList ( )
virtual
static DtSimComponentManagerFactory* DtSimComponentManager::factory ( )
static

A DtSimEntityFactory is allocated by the DtSimCreator, and this pointer is set. The DtSimCreator deletes this pointer when it is deleted. This is done this way because we don't allow static initialization.

static void DtSimComponentManager::setFactory ( DtSimComponentManagerFactory factory)
static
static void DtSimComponentManager::addSimComponentManagerCreatorFcn ( const DtString type,
DtSimComponentManagerCreatorFcn  fcn 
)
static
static DtSimComponentManager* DtSimComponentManager::creator ( DtLocalObject vrfObject)
static
static DtSimComponentManager* DtSimComponentManager::createComponentManager ( const DtString type,
DtLocalObject vrfObject 
)
static

Creates a new component manager, using the factory.

virtual void DtSimComponentManager::allSystems ( DtComponentSystemList ) const
virtual

Given the supplied system list, puts all known systems into the list (including the base system)

virtual bool DtSimComponentManager::hasSystemThatCanBeDisabled ( )
virtual

Returns whether this has a system that can be disabled.

static void DtSimComponentManager::systemListRequestCallback ( const DtVrfObjectMessage msg,
void *  usr 
)
static

Responds to system list requests with list of system names associated with this entity.

virtual void DtSimComponentManager::processSystemListRequest ( const DtVrfObjectMessage msg)
virtual

Responds to system list requests with list of system names associated with this entity.

static void DtSimComponentManager::genericSetRwRequestCallback ( const DtVrfObjectMessage msg,
void *  usr 
)
static

Responds to generic SetRw requests with data associated with this entity.

virtual void DtSimComponentManager::processGenericSetRwRequest ( const DtVrfObjectMessage msg)
virtual

Responds to generic SetRw requests with data associated with this entity.

static void DtSimComponentManager::notifySetDataSubscriberCallback ( DtSimMessage msg,
void *  usr 
)
static
virtual void DtSimComponentManager::notifySetDataSubscriber ( DtSimMessage msg)
virtual
virtual void DtSimComponentManager::sendGenericSetRwStateSubscribersUpdate ( const DtSetMessageType type,
const DtUUID uuid = DtUUID::nullUUID() 
)
virtual
virtual void DtSimComponentManager::sendSystemStateUpdated ( const std::vector< DtComponentSystem * > &  system)
virtual

Sends the current state of the system.

virtual void DtSimComponentManager::sendSystemStateUpdated ( DtComponentSystem system)
virtual
virtual void DtSimComponentManager::allSystems ( DtComponentSystemList ,
DtComponentSystem  
) const
protectedvirtual

Used recursively from allSystems(). Adds the supplied system then iterates over component network for other systems.

Member Data Documentation

DtLocalObject* DtSimComponentManager::myVrfObject
protected
DtComponentSystem* DtSimComponentManager::myComponentSystem
protected
DtList DtSimComponentManager::myConnectionList
protected
DtList DtSimComponentManager::myGroupConnectionList
protected
std::set<DtUUID> DtSimComponentManager::mySystemStateSubscribers
protected
std::map< DtString, std::set< DtUUID > > DtSimComponentManager::myGenericSetRwStateSubscribers
protected
DtSimComponentManagerFactory* DtSimComponentManager::theFactory
staticprotected

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)