WSF
WsfCallback Class Referenceabstract

#include <WsfCallback.hpp>

Inheritance diagram for WsfCallback:
Collaboration diagram for WsfCallback:

Public Member Functions

 WsfCallback ()
 ~WsfCallback () override
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
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)
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 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 PreInitialize (double aSimTime)
virtual bool Initialize (double aSimTime)
virtual bool Initialize2 (double aSimTime)
virtual void PreInput ()

Component infrastructure methods

WsfComponentCloneComponent () const override
WsfStringId GetComponentName () const override
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) override
WsfCallbackClone () const override=0
virtual bool Execute (double aSimTime, WsfPlatform *aPlatformPtr)=0
bool ProcessInput (UtInput &aInput) override
static bool ExecuteAndNotify (double aSimTime, WsfPlatform *aPlatformPtr, WsfStringId aCallbackName)
 WsfCallback (const WsfCallback &aSrc)

Additional Inherited Members

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

Detailed Description

WsfCallback provides the functionality to create callbacks that execute within the context of a platform or one of its processors.

This functionality was created prior the existence of the scripting language and is now to be considered deprecated. The only known use is by the air_traffic extension (XWsfAirTraffic).

Constructor & Destructor Documentation

◆ WsfCallback() [1/2]

◆ ~WsfCallback()

WsfCallback::~WsfCallback ( )
override

◆ WsfCallback() [2/2]

WsfCallback::WsfCallback ( const WsfCallback & aSrc)
protected

Member Function Documentation

◆ Clone()

WsfCallback * WsfCallback::Clone ( ) const
overridepure virtual

Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.

Implements WsfObject.

Implemented in WsfScriptCallback, and XWsfAirTraffic::UpdateFlightStatusCallback.

References WsfCallback().

Referenced by wsf::six_dof::Mover::ExecuteTriggers(), and WsfP6DOF_Mover::ExecuteTriggers().

◆ CloneComponent()

WsfComponent * WsfCallback::CloneComponent ( ) const
inlineoverridevirtual

Clones a component. May return null if component does not support clone.

Implements WsfComponent.

References WsfObject::Clone().

◆ Execute()

virtual bool WsfCallback::Execute ( double aSimTime,
WsfPlatform * aPlatformPtr )
pure virtual

◆ ExecuteAndNotify()

bool WsfCallback::ExecuteAndNotify ( double aSimTime,
WsfPlatform * aPlatformPtr,
WsfStringId aCallbackName )
static

Primary entry for invoking a callback from other simulation components. This is what is called when another simulation wants to trigger the callback. This routine invokes the Execute method and also invokes things like simulation observers.

Parameters
aSimTimeThe current simulation time.
aPlatformPtrThe platform executing the callback
aCallbackNameThe name of the callback to execute
Returns
The status from the callback Execute method.

References WsfComponentList::RoleIterator< T >::AtEnd(), Execute(), WsfObserver::ExecuteCallback(), WsfComponentList::GetComponent(), WsfObject::GetName(), WsfPlatform::GetSimulation(), and WsfCallback().

Referenced by wsf::six_dof::Mover::ExecuteTriggers(), and WsfP6DOF_Mover::ExecuteTriggers().

◆ GetComponentName()

WsfStringId WsfCallback::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()

const int * WsfCallback::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_CALLBACK.

◆ ProcessInput()

bool WsfCallback::ProcessInput ( UtInput & aInput)
inlineoverridevirtual

Process input from a generic source.

Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the class or 'false' if not.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.
Note
If a derived class does not recognize the command (i.e.: the return value is false) then it should call the base class ProcessInput method. This chain should continue until either the command is recognized or the top-level base class is encountered.

Reimplemented from WsfObject.

Reimplemented in WsfScriptCallback.

◆ QueryInterface()

void * WsfCallback::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.

References cWSF_COMPONENT_CALLBACK.


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