![]() |
VR-Forces Development_Version Class Documentation
|
A DtComponentSystem is a collection of DtSimComponents that are associated with each other. More...

Public Types | |
| typedef std::list< std::pair < DtSimComponent *, DtString > > | DtComponentPortList |
Public Member Functions | |
| DtComponentSystem (DtVrfObject *owner, DtSimManager *simManager, const DtComponentSystemDescriptor *desc, DtComponentSystem *parentSystem) | |
| virtual | ~DtComponentSystem () |
| virtual bool | init () |
| virtual bool | initializeFromDescriptor (int &priority, bool remoteOnly) |
| Creates the components, systems, and resources specified in the descriptor for the system. | |
| virtual bool | postAddComponentsInit () |
| Calls DtSimComponent::postAddComponentsInit() on all contained components. | |
| virtual void | tick () |
| Calls DtSimCompoennt::tick() on all contained components. | |
| virtual DtString | name () const |
| virtual DtString | fullName () const |
| virtual DtString | printName () const |
| virtual void | setPrintName (const DtString &name) |
| Sets the print name of the system. | |
| virtual DtComponentSystem * | lookupSystem (const DtString &printName) |
| Finds a system within this system that matches the given print name. | |
| virtual DtComponentSystem * | lookupSystemFromRwName (const DtString &rwName) |
| Finds a system within this system that matches the given name. | |
| virtual void | getSystemNames (std::list< std::string > &nameList) const |
| Adds the system's print name and the names of all subsystems in this system to the list in nameList. | |
| virtual DtVrfProcessStateRepositoryManager * | processStateRepositoryManager () |
| Provides a list of all of the systems, by print name, in this system. | |
| virtual void | restoreResources () |
| Restores resource values to the values specified in the parameters for this system and all child systems. | |
| virtual DtSimComponentNetwork * | componentNetwork () |
| virtual const DtSimComponentNetwork * | componentNetwork () const |
| virtual DtSimResourceManager & | resourceManager () |
| virtual const DtSimResourceManager & | resourceManager () const |
| virtual void | resolveSystemOutput (const DtString &outputName, DtComponentPortList &componentOutputs) |
| Within systems, connections are made from components to "system" or vice versa. | |
| virtual void | resolveSystemInput (const DtString &inputName, DtComponentPortList &componentInputs) |
| Within systems, connections are made from components to "system" or vice versa. | |
| virtual void | enable () |
| Enables/disables components/systems in the system. | |
| virtual void | disable () |
| Enables/disables components/systems in the system. | |
| virtual bool | isEnabled () |
| Check if the system is enabled, component's tick function will be called, otherwise it will not. | |
| virtual void | setIsEnabled (bool yesNo) |
| Check if the system is enabled, component's tick function will be called, otherwise it will not. | |
| virtual bool | addAttributeProviderFunction (DtString &attributeName, genericAttributeProviderFunctionType attributeFunction, void *controller) |
| Functions for defining system attribute functions, and getting attributes. | |
| virtual bool | addAttributeSetFunction (DtString &attributeName, genericAttributeSetterFunctionType attributeFunction, void *controller) |
| Similar to above, but adds a function to myWritableAttributes. | |
| virtual DtReaderWriter * | getAttribute (const DtString &attributeName, bool &error) const |
| Retrieves the attribute value (by running the function mapped to this attribute).The status of the get is returned in the error parameter. | |
| virtual bool | setAttribute (const DtString &attributeName, DtReaderWriter *value) |
| Sets the attribute value (by running the function mapped to this attribute). | |
| virtual std::list< std::string > | getAllAttributeNames () const |
| Gets the names of all of the attributes that have been registered by provider (i.e., Get) functions for this system. | |
Protected Member Functions | |
| virtual bool | createPsr () |
| Creates the PSR and sets it to myProcessStateRepository. | |
| void | removeCompatibilityPsrs () |
| Non-virtual because it is called by the destructor. | |
Protected Attributes | |
| const DtComponentSystemDescriptor * | mySystemDescriptor |
| DtSimManager * | mySimManager |
| DtVrfObject * | myVrfObject |
| DtSimComponentNetwork * | myComponentNetwork |
| DtComponentSystemPSR * | myProcessStateRepository |
| DtComponentSystem * | myParentSystem |
| DtString | myPrintName |
| A customized print name, if one was specified. | |
| std::map< DtString, std::pair < genericAttributeProviderFunctionType, void * > > | myReadableAttributes |
| Map of attribute-names to provider-functions. | |
| std::map< DtString, std::pair < genericAttributeSetterFunctionType, void * > > | myWritableAttributes |
| std::list< std::pair< DtString, DtVrfProcessStateRepositoryManager * > > | myAddedCompatibilityPsrs |
| This list is kept so the compatibility PSRs can be removed upon destruction. | |
Private Member Functions | |
| DtComponentSystem () | |
| Not Implemented. | |
| DtComponentSystem (const DtComponentSystem &orig) | |
| Not Implemented. | |
| DtComponentSystem & | operator= (const DtComponentSystem &orig) |
| Not Implemented. | |
A DtComponentSystem is a collection of DtSimComponents that are associated with each other.
Calling tick() on the system results in tick() being called on all the components of the system. A system may also contain other systems.
| typedef std::list< std::pair<DtSimComponent*, DtString> > DtComponentSystem::DtComponentPortList |
|
private |
Not Implemented.
|
private |
Not Implemented.
| DtComponentSystem::DtComponentSystem | ( | DtVrfObject * | owner, |
| DtSimManager * | simManager, | ||
| const DtComponentSystemDescriptor * | desc, | ||
| DtComponentSystem * | parentSystem | ||
| ) |
|
virtual |
|
private |
Not Implemented.
|
virtual |
Reimplemented in DtTopLevelComponentSystem.
|
virtual |
Creates the components, systems, and resources specified in the descriptor for the system.
The first component is created with the specified priority, and priority is incremented for each component created. The next available priority value is return in priority.
| remoteOnly | If true, then only components configured for remote objects are created. |
|
virtual |
Calls DtSimComponent::postAddComponentsInit() on all contained components.
|
virtual |
Calls DtSimCompoennt::tick() on all contained components.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Sets the print name of the system.
This function can be used by components that have customizable display names in their descriptors, e.g. the range ring names for guns. The customizable names may be important for identifying the system if more than one system of the same type is included on an entity.
|
virtual |
|
virtual |
|
virtual |
Finds a system within this system that matches the given print name.
If this system matches, it is returned; otherwise, the systems in the component network are checked recursively.
|
virtual |
Finds a system within this system that matches the given name.
This function tests the given name against the RW name rather than the print name of the system. If this system matches, it is returned; otherwise, the systems in the component network are checked recursively.
|
virtual |
Adds the system's print name and the names of all subsystems in this system to the list in nameList.
|
virtual |
Provides a list of all of the systems, by print name, in this system.
virtual std::list<DtString> getSubsystemList();
|
virtual |
Reimplemented in DtTopLevelComponentSystem.
|
virtual |
Reimplemented in DtTopLevelComponentSystem.
|
virtual |
Restores resource values to the values specified in the parameters for this system and all child systems.
|
virtual |
Within systems, connections are made from components to "system" or vice versa.
This designates that as a public input/output to the system. External connections can be made to these named connections, which in turn result in a connection down to the actual component within the system. These methods take the system connection name and resolve it to the internal components and ports on those components. Each method fills the second parameter with a list of component pointers and port names on that component that should be connected to.
|
virtual |
Within systems, connections are made from components to "system" or vice versa.
This designates that as a public input/output to the system. External connections can be made to these named connections, which in turn result in a connection down to the actual component within the system. These methods take the system connection name and resolve it to the internal components and ports on those components. Each method fills the second parameter with a list of component pointers and port names on that component that should be connected to.
|
virtual |
Enables/disables components/systems in the system.
|
virtual |
Enables/disables components/systems in the system.
|
virtual |
Check if the system is enabled, component's tick function will be called, otherwise it will not.
Default is true (enabled).
|
virtual |
Check if the system is enabled, component's tick function will be called, otherwise it will not.
Default is true (enabled).
|
virtual |
Functions for defining system attribute functions, and getting attributes.
Adds a function that will provide the value of the given attribute. The name-function pair is put in the map myReadableAttributes. The function should create a new DtReaderWriter of the appropriate sub-type (e.g., DtRwInt, DtRwString, etc.) and return a pointer to it. Users of this data are responsible for deleting it. Controllers should call, in their init functions, these functions to register attributes the controllers support. The call in the controller will use their mySystem object.
If there was already a function registered for the same attribute, this add... function will do nothing; i.e. this is not an error. Thus some care must be used in defining attribute names, but usually the registrations work as desired. For example, in a movement system there may be several task controllers all of which use a move-along-route controller that provides a next-waypoint-index attribute (e.g. move-along, patrol-route). If the move-along controller registers to provide the attribute, all derived controllers will fail when they register. However, if all these controllers get the attribute data from the same PSR, the correct information will be returned for patrol-route even if move-along provides the attribute value.
|
virtual |
Similar to above, but adds a function to myWritableAttributes.
The function registered here should take a Reader-Writer value and check its type before using its value. It should return True if there is an error.
|
virtual |
Retrieves the attribute value (by running the function mapped to this attribute).The status of the get is returned in the error parameter.
|
virtual |
Sets the attribute value (by running the function mapped to this attribute).
The value is passed in as a Reader-Writer. This function does not delete the RW.
Note that setting an attribute can be used to trigger actions.
|
virtual |
Gets the names of all of the attributes that have been registered by provider (i.e., Get) functions for this system.
|
protectedvirtual |
Creates the PSR and sets it to myProcessStateRepository.
|
protected |
Non-virtual because it is called by the destructor.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
A customized print name, if one was specified.
Initialized by a component, or defaults to print name in metadata.
|
protected |
Map of attribute-names to provider-functions.
|
protected |
|
protected |
This list is kept so the compatibility PSRs can be removed upon destruction.