WSF
WsfMultiresolutionPlatformComponent< DerivedComponent > Class Template Referenceabstract

A base class template for defining multiresolution WsfPlatformComponent types. More...

#include <WsfMultiresolutionPlatformComponent.hpp>

Inheritance diagram for WsfMultiresolutionPlatformComponent< DerivedComponent >:
Collaboration diagram for WsfMultiresolutionPlatformComponent< DerivedComponent >:

Public Member Functions

 WsfMultiresolutionPlatformComponent ()
Public Member Functions inherited from WsfComponentT< WsfPlatform >
 WsfComponentT ()
 WsfComponentT (const WsfComponentT &) noexcept
WsfComponentToperator= (const WsfComponentT &) noexcept
 ~WsfComponentT () override=default
virtual void ComponentParentChanged (ParentType *aParentPtr)
ParentTypeGetComponentParent () const
void SetComponentParent (ParentType *aParentPtr)
Public Member Functions inherited from WsfComponent
virtual ~WsfComponent ()=default
virtual WsfComponentCloneComponent () const =0
virtual int GetComponentInitializationOrder () const
template<typename T>
bool QueryInterfaceT (T *&aRolePtr)
bool ComponentHasRole (int aRole)
 Returns true if the component has the specified role.
virtual bool Initialize (double aSimTime)
virtual bool Initialize2 (double aSimTime)
virtual void PreInput ()
Public Member Functions inherited from WsfObject
 WsfObject ()
 This is the constructor for the WsfObject class.
 ~WsfObject () override
 This is the destructor for the WsfObject class.
const char * GetScriptClassName () const override
virtual WsfObjectClone () const =0
const std::string & GetType () const
WsfStringId GetTypeId () const
 Get the string ID of the 'type' of the object.
void SetType (WsfStringId aType)
const std::string & GetBaseType () const
WsfStringId GetBaseTypeId () const
const TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (const WsfObject &aRhs)
 Assignment operator.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)

Framework methods.

bool ProcessInput (UtInput &aInput) override
bool PreInitialize (double aSimTime) override
virtual std::unique_ptr< DerivedComponent > GetModel () const =0
double GetFidelity () const

Component infrastructure methods.

WsfStringId GetComponentName () const override
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) override
static WsfMultiresolutionPlatformComponent< DerivedComponent > * Find (const WsfPlatform &aParent)

Additional Inherited Members

Public Types inherited from WsfComponentT< WsfPlatform >
typedef WsfPlatform ParentType
 This is needed to support the WsfComponentList template.
Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Detailed Description

template<typename DerivedComponent>
class WsfMultiresolutionPlatformComponent< DerivedComponent >

A base class template for defining multiresolution WsfPlatformComponent types.

The purpose of the base class is to manage input and model installation on a platform. The input to a multiresolution model is a fidelity parameter and will be extended to other model attributes. The fidelity may be specified directly in the input of this class, or externally using WsfMultiresolutionMultirunTable. These inputs are used by the derived type to create a model (returned from GetModel), which is then installed on the platform.

Template Parameters
DerivedComponentA type deriving from WsfPlatformComponent

Constructor & Destructor Documentation

◆ WsfMultiresolutionPlatformComponent()

template<typename DerivedComponent>
WsfMultiresolutionPlatformComponent< DerivedComponent >::WsfMultiresolutionPlatformComponent ( )

Member Function Documentation

◆ Find()

template<typename DerivedComponent>
WsfMultiresolutionPlatformComponent< DerivedComponent > * WsfMultiresolutionPlatformComponent< DerivedComponent >::Find ( const WsfPlatform & aParent)
static

◆ GetComponentName()

template<typename DerivedComponent>
WsfStringId WsfMultiresolutionPlatformComponent< DerivedComponent >::GetComponentName ( ) const
inlineoverridevirtual

Returns the component's name. Each component in a component list has a unique name. Names are usually defined by the user, but they may also be generated by code and prefixed with a '#' to guarantee no collisions with user-defined names.

Implements WsfComponent.

References WsfObject::GetNameId().

◆ GetComponentRoles()

template<typename DerivedComponent>
const int * WsfMultiresolutionPlatformComponent< DerivedComponent >::GetComponentRoles ( ) const
overridevirtual

Returns a zero-terminated array of component roles. Note that the array should be in decreasing order of specificity and should generally the inheritance hierarchy. The first entry should be the components 'primary' role. For example a sensor would do the following:

return roles;
@ cWSF_COMPONENT_SENSOR
A 'sensor' component (WsfSensor).
Definition WsfComponentRoles.hpp:105
@ cWSF_COMPONENT_PLATFORM_PART
The component derives from WsfPlatformPart.
Definition WsfComponentRoles.hpp:98
@ cWSF_COMPONENT_ARTICULATED_PART
The component derives from WsfArticulatedPart.
Definition WsfComponentRoles.hpp:99

Implements WsfComponent.

References cWSF_COMPONENT_NULL.

◆ GetFidelity()

template<typename DerivedComponent>
double WsfMultiresolutionPlatformComponent< DerivedComponent >::GetFidelity ( ) const
protected
Returns
The fidelity value associated with this component, which may be different from mFidelity. This checks with MultiresolutionMultirunTable for changes to the fidelity value in a multirun setting.

References WsfMultiresolutionMultirunTable::Find(), WsfComponentT< WsfPlatform >::GetComponentParent(), WsfMultiresolutionMultirunTable::GetFidelity(), WsfObject::GetName(), and wsf::multiresolution::RequiresUserInputName().

◆ GetModel()

template<typename DerivedComponent>
virtual std::unique_ptr< DerivedComponent > WsfMultiresolutionPlatformComponent< DerivedComponent >::GetModel ( ) const
protectedpure virtual

The main responsibility of derived classes is to implement this method. It returns the model that will be installed on the platform by the base class.

Returns
A model generated from inputs such as fidelity.

Referenced by PreInitialize().

◆ PreInitialize()

template<typename DerivedComponent>
bool WsfMultiresolutionPlatformComponent< DerivedComponent >::PreInitialize ( double aSimTime)
overridevirtual

Perform pre-initializion function. This is called by WsfPlatform::Initialize prior to actually initializing the components on a platform (i.e.: calling Initialize and Initialize2 for each component). The primary reason for this method is to allow components to add other components that will then be subsequently initialized. The component may examine the component list and add components, but it must not assume ANYTHING about the actual state of the component.

Parameters
aSimTimeThe current simulation time.
Returns
true if successful or false if unsuccessful (bad input data, etc.)

Reimplemented from WsfComponent.

References wsf::multiresolution::CommandName(), WsfComponentT< WsfPlatform >::GetComponentParent(), GetModel(), WsfObject::GetName(), ok, and WsfComponent::PreInitialize().

◆ ProcessInput()

template<typename DerivedComponent>
bool WsfMultiresolutionPlatformComponent< DerivedComponent >::ProcessInput ( UtInput & aInput)
overridevirtual

Evaluate the current input command and determine if it is one processed by the component. The component should get the current command from the input stream and determine if it is one that it recognizes. If it does not recognize the command then it should leave the command in the input stream and return false. If it does recognize the command then it should process the command and return true. If invalid arguments are encountered then it should throw an exception.

Parameters
aInputThe input stream.
Returns
true if the current command was recognized (and processed), or false if the command was not recognized.
Exceptions
UtInput::ExceptionBaseif an invalid input was encountered.

Reimplemented from WsfComponent.

Reimplemented in WsfMultiresolutionWrapperMetaModel< DerivedComponent >.

References wsf::multiresolution::CommandName(), WsfComponent::ProcessInput(), and WsfObject::ProcessInput().

Referenced by WsfMultiresolutionWrapperMetaModel< DerivedComponent >::ProcessInput().

◆ QueryInterface()

template<typename DerivedComponent>
void * WsfMultiresolutionPlatformComponent< DerivedComponent >::QueryInterface ( int aRole)
overridevirtual

Requests a component's role interface. A component can support one or more roles.

Parameters
aRoleThe role whose interface is to be returned.
Returns
A pointer to the object if it supports the indicated role, or 'null' if it does not. Usage: WsfProcessor* procPtrOrNull = (WsfProcessor*)componentPtr->QueryComponentInterface(cWSF_COMPONENT_PROCESSOR);

Implements WsfComponent.


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved