WSF
WsfScriptCallback Class Reference

#include <WsfScriptCallback.hpp>

Inheritance diagram for WsfScriptCallback:
Collaboration diagram for WsfScriptCallback:

Public Member Functions

 WsfScriptCallback ()=default
 WsfScriptCallback (const std::string &aScriptName)
 WsfScriptCallback (const std::string &aScriptName, const std::string &aProcessorName)
 WsfScriptCallback (const UtScriptMethod &aMethod)
WsfScriptCallbackoperator= (const WsfScriptCallback &aRhs)=delete
 ~WsfScriptCallback () override
WsfCallbackClone () const override
bool Initialize (double aSimTime) override
bool ProcessInput (UtInput &aInput) override
bool Execute (double aSimTime, WsfPlatform *aPlatformPtr) override
Public Member Functions inherited from WsfCallback
 WsfCallback ()
 ~WsfCallback () override
WsfComponentCloneComponent () const override
WsfStringId GetComponentName () const override
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) 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 Initialize2 (double aSimTime)
virtual void PreInput ()

Protected Member Functions

 WsfScriptCallback (const WsfScriptCallback &aSrc)
 WsfCallback (const WsfCallback &aSrc)
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

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.
static bool ExecuteAndNotify (double aSimTime, WsfPlatform *aPlatformPtr, WsfStringId aCallbackName)

Detailed Description

WsfScriptCallback provides the ability to execute a list of scripts. Each script can specify where it will execute, which can be either the platform itself or one of its processors.

Constructor & Destructor Documentation

◆ WsfScriptCallback() [1/5]

WsfScriptCallback::WsfScriptCallback ( )
default

◆ WsfScriptCallback() [2/5]

WsfScriptCallback::WsfScriptCallback ( const std::string & aScriptName)

◆ WsfScriptCallback() [3/5]

WsfScriptCallback::WsfScriptCallback ( const std::string & aScriptName,
const std::string & aProcessorName )

◆ WsfScriptCallback() [4/5]

WsfScriptCallback::WsfScriptCallback ( const UtScriptMethod & aMethod)

◆ ~WsfScriptCallback()

WsfScriptCallback::~WsfScriptCallback ( )
override

◆ WsfScriptCallback() [5/5]

WsfScriptCallback::WsfScriptCallback ( const WsfScriptCallback & aSrc)
protected

Member Function Documentation

◆ Clone()

WsfCallback * WsfScriptCallback::Clone ( ) const
overridevirtual

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

Implements WsfCallback.

References WsfCallback::WsfCallback(), and WsfScriptCallback().

◆ Execute()

bool WsfScriptCallback::Execute ( double aSimTime,
WsfPlatform * aPlatformPtr )
overridevirtual

Executes the list of scripts in the appropriate contexts. The context can either be the platform itself or one of its processors.

Implements WsfCallback.

References WsfPlatform::ExecuteScript(), WsfScriptProcessor::ExecuteScript(), WsfComponentList::GetComponent(), WsfScriptContext::GetContext(), WsfObject::GetName(), WsfPlatform::GetScriptContext(), WsfSimulation::GetScriptExecutor(), WsfPlatform::GetSimulation(), ok, and success.

◆ Initialize()

bool WsfScriptCallback::Initialize ( double aSimTime)
overridevirtual

Perform phase 1 initialization. This is called by WsfPlatform::Initialize() during phase 1 initialization of the platform. The component should complete validation of input data that could not be done by ProcessInput, as well as any other functions to prepare for simulation use (subject to the next paragraph).

The order in which components are initialized is defined by GetComponentInitializationOrder. In general a component implementation of this method should not be dependent on the state of another component, i.e.: it should not assume that the other components Initialize() method has been called. If such a dependency exists one should use Initialize2() if possible, or specify a value GetComponentInitializationOrder to force things to initialize in a particular order.

Parameters
aSimTimeThe current simulation time.
Returns
true if successful or false if unsuccessful (bad input data, etc.)
Note
This method should NOT add any other components to the platform. This MUST be done in PreInitialize().

Reimplemented from WsfComponent.

References WsfScriptContext::FindScript(), WsfComponentList::GetComponent(), WsfComponentT< WsfPlatform >::GetComponentParent(), WsfObject::GetName(), WsfPlatform::GetScriptContext(), WsfScriptProcessor::GetScriptContext(), ok, and success.

◆ operator=()

WsfScriptCallback & WsfScriptCallback::operator= ( const WsfScriptCallback & aRhs)
delete

◆ ProcessInput()

bool WsfScriptCallback::ProcessInput ( UtInput & aInput)
overridevirtual

Processes the input for a list of script calls and where they will execute (platform or one of its processors).

Reimplemented from WsfCallback.


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