WSF
WsfScriptContext Class Reference

#include <WsfScriptContext.hpp>

Collaboration diagram for WsfScriptContext:

Classes

class  ExecuteTimedEventScript
 An event to execute a script at a specified time. More...

Public Member Functions

 WsfScriptContext (UtScriptEnvironment *aTypesPtr)
 WsfScriptContext (WsfScriptContext &aParentContext, WsfStringId aPartClassName, const std::string &aPartVarName)
 WsfScriptContext (WsfScriptContext &aParentContext, WsfStringId aObjectClassName)
 WsfScriptContext (const WsfScriptContext &aSrc)
 Copy constructor.
WsfScriptContextoperator= (const WsfScriptContext &aRhs)
virtual ~WsfScriptContext ()
virtual bool Initialize (double aSimTime, WsfPlatform *aPlatformPtr, WsfPlatformPart *aPartPtr)
virtual bool Initialize (WsfSimulation &aSimulation, void *aObjectPtr)
virtual bool Initialize (double aSimTime, WsfScriptContext &aParentContext, void *aObjectPtr)
virtual bool Initialize2 (double aSimTime)
virtual bool InitializeGlobalContext (WsfSimulation &aSimulation)
 Initialize the global script context.
virtual bool ProcessInput (UtInput &aInput)
virtual void Update (double aSimTime)
 Invoke the 'on_update' script if it is defined.
UtScript * Compile (UtInput &aInput, const std::string &aEndBlockToken="end_script", const std::string &aNamespace="")
UtScript * Compile (const std::string &aScriptName, WsfStringId aScriptReturnType, UtInput &aInput, const std::string &aEndBlockToken="end_script", const std::string &aNamespace="", bool aIsVariableBlock=false)
UtScript * CompileImplicitScript (UtInput &aInput, const std::string &aName, WsfStringId aReturnType)
void CompileVariables (UtInput &aInput)
void DeclareVariable (WsfStringId aType, const std::string &aName)
bool ExecuteScript (double aSimTime, WsfStringId aScriptName)
void ExecuteScript (double aSimTime, UtScript *aScriptPtr)
bool ExecuteScript (double aSimTime, WsfStringId aScriptName, UtScriptData &aScriptRetVal, const UtScriptDataList &aScriptArgs)
void ExecuteScript (double aSimTime, UtScript *aScriptPtr, UtScriptData &aScriptRetVal, const UtScriptDataList &aScriptArgs)
void ExecuteScript (UtScript *aScriptPtr, UtScriptData &aScriptRetVal, const UtScriptDataList &aScriptArgs)
bool ExecuteScript (double aSimTime, UtScriptData &aScriptRetVal, const UtScriptDataList &aScriptArgs, const std::string &aScriptSource)
virtual UtScript * FindScript (WsfStringId aScriptName) const
UtScriptContext & GetContext () const
 Return a reference to the real script context.
WsfScriptContextGetGlobalContext ()
UtScriptTypes * GetTypes () const
 Return a pointer to the UtScriptTypes object.
UtScriptEnvironment * GetEnvironment () const
 Return a pointer to the UtScriptEnvironment object.
UtScriptClass * GetClass (const std::string &aClassName) const
 Return a pointer to the script class object given its class name.
UtScriptClass * GetClass (WsfStringId aClassName) const
 Return a pointer to the script class object given its class name (ID).
UtScriptClass * GetClass (const char *aClassName) const
 Return a pointer to the script class object given its class name.
bool HasUpdateHandler () const
 Return 'true' if an 'on_update' script is defined.
void SetParent (WsfScriptContext *aParentPtr)
void SetParent (UtScriptContext *aParentPtr)
bool ValidateScript (UtScript *aScriptPtr, WsfStringId aReturnType, const std::string &aArgumentTypes) const
WsfPlatformPartGetPart ()
WsfSimulationGetSimulation () const
const WsfScenarioGetScenario () const
UtScriptExecutor * GetExecutor () const

Static Public Member Functions

static double GetTIME_NOW (const UtScriptContext &aContext)
static WsfPlatformGetPLATFORM (const UtScriptContext &aContext)
static WsfProcessorGetPROCESSOR (const UtScriptContext &aContext)
static WsfMessageGetMESSAGE (const UtScriptContext &aContext)
static WsfTrackGetTRACK (const UtScriptContext &aContext)
static WsfSimulationGetSIMULATION (const UtScriptContext &aContext)
static WsfScenarioGetSCENARIO (const UtScriptContext &aContext)
static WsfEventPipeInterfaceGetEVENTPIPE (const UtScriptContext &aContext)

Protected Member Functions

UtScriptData GetSimTimeP ()
bool AddTimedEvents (double aSimTime)
 Add events to invoke scripts at the requested time.
void CallScript (UtScript *aScriptPtr, UtScriptData &aScriptRetVal, const UtScriptDataList &aScriptArgs)
 Calls a script, with optional call tracing.
void PostCompile (UtInput &aInput, UtScript *aRawScriptPtr)
 Perform common operations after attempted compilation.
void WriteErrorHeader (UtScript *aScriptPtr) const

Protected Attributes

WsfScriptContextmParentPtr {nullptr}
 Pointer to my immediate parent WsfScriptContext (nullptr if the global context).
std::unique_ptr< UtScriptContext > mContextPtr
 The real UtScriptContext that is associated with this object.
std::vector< TimedEvent > mTimedEvents
WsfSimulationmSimulationPtr {nullptr}
WsfPlatformmPlatformPtr {nullptr}
 If not the global context, this is the pointer to the associated platform.
WsfPlatformPartmPlatformPartPtr {nullptr}
 If the context is for a platform part, this is its pointer.
WsfStringId mPartClassName {}
 The platform part class name.
WsfStringId mPartVarName {}
 The platform part variable name.
WsfStringId mObjectClassName {}
 The class name for a non-platform oriented object.
std::unique_ptr< ReadTIME_NOW > mTimeNowFunctionPtr
UtScript * mOnUpdateScriptPtr {nullptr}
bool mScriptCallTrace {false}
 'true' if call tracing is enabled.
bool mUserDefinedScriptCallTrace {false}
 'true' if the user defined a value for script_call_trace
bool mScriptPrintCode {false}
 'true' if script_print_code is enabled (prints the generated code after compiled)
bool mScriptCheckError {false}
bool mScriptExpectError {false}
 The value of 'script_expect_error'.

Detailed Description

A common implementation for scripting on a platform or a platform part.

This class encapsulates many of the conventions that need to be followed for implementing scripting on a platform or a platform part. In particular, it provides the following:

  • Implements the command 'script/end_script' and 'script_variables/end_script_variables'.
  • Implements the command 'on_initialize', which allows a script to be defined when the platform or platform part is initialized.
  • Implements the command 'on_update', which allows a script to be defined that gets called when the Update() method is called.
  • Internally provides all the necessary UtScript() and UtScriptContext() calls to maintain the script context, compile scripts and copy construct and delete as necessary.
  • Maintains the script variables 'PLATFORM', 'TIME_NOW' and optionally an additional variable that points to the platform part (e.g.: 'PROCESSOR').

The user of this class is responsible for the following:

Constructor & Destructor Documentation

◆ WsfScriptContext() [1/4]

WsfScriptContext::WsfScriptContext ( UtScriptEnvironment * aTypesPtr)

Construct the global script context. The global script context is like any other script context except that it is not associated with a specific platform or processor.

References mContextPtr.

Referenced by WsfScriptContext::ExecuteTimedEventScript::ExecuteTimedEventScript(), GetGlobalContext(), Initialize(), operator=(), SetParent(), WsfScriptContext(), WsfScriptContext(), WsfScriptContext(), and ~WsfScriptContext().

◆ WsfScriptContext() [2/4]

WsfScriptContext::WsfScriptContext ( WsfScriptContext & aParentContext,
WsfStringId aPartClassName,
const std::string & aPartVarName )

Construct a script context for a platform or a platform part.

Parameters
aParentContextThe script context of the parent object.
aPartClassNameThe script class name (e.g.: WsfProcessor) of the host platform part. If the string is empty then no host script variable will be defined.
aPartVarNameThe script variable name (e.g.: PROCESSOR) through which the script object will be referenced.

References GetEnvironment(), mContextPtr, mPartClassName, mPartVarName, and WsfScriptContext().

◆ WsfScriptContext() [3/4]

WsfScriptContext::WsfScriptContext ( WsfScriptContext & aParentContext,
WsfStringId aObjectClassName )

Construct a script context for a global object (i.e.: not associated with a platform or platform part).

Parameters
aParentContextThe script context of the parent object.
aObjectClassNameThe script class name (e.g.: WsfPlatform) of the object.

References GetEnvironment(), mContextPtr, mObjectClassName, SetParent(), and WsfScriptContext().

◆ WsfScriptContext() [4/4]

◆ ~WsfScriptContext()

Member Function Documentation

◆ AddTimedEvents()

bool WsfScriptContext::AddTimedEvents ( double aSimTime)
protected

◆ CallScript()

void WsfScriptContext::CallScript ( UtScript * aScriptPtr,
UtScriptData & aScriptRetVal,
const UtScriptDataList & aScriptArgs )
protected

◆ Compile() [1/2]

UtScript * WsfScriptContext::Compile ( const std::string & aScriptName,
WsfStringId aScriptReturnType,
UtInput & aInput,
const std::string & aEndBlockToken = "end_script",
const std::string & aNamespace = "",
bool aIsVariableBlock = false )

Compiles the script using the provided script context and script name and return type.

Parameters
aScriptNameThe name to give the script.
aScriptReturnTypeThe return type to use when compiling the script.
aInputThe input stream containing the script.
aEndBlockTokenThe string that indicates the end of the script (e.g.: "end_script").
aNamespaceA name that is prepended to the script name.
aIsVariableBlockTrue if this block is a 'script_variables' block This is useful to deconflict script's with the same name.
Exceptions
Anexception if a compile error occurs.

References mContextPtr, and PostCompile().

◆ Compile() [2/2]

UtScript * WsfScriptContext::Compile ( UtInput & aInput,
const std::string & aEndBlockToken = "end_script",
const std::string & aNamespace = "" )

Compile a script and add it to the list of managed scripts.

Parameters
aInputThe input stream containing the script.
aEndBlockTokenThe string that indicates the end of the script (e.g.: "end_script").
aNamespaceA name that is prepended to the script name. This is useful to deconflict script's with the same name.
Exceptions
Anexception if a compile error occurs.

References mContextPtr, and PostCompile().

Referenced by CompileImplicitScript(), CompileVariables(), ExecuteScript(), wsf::cyber::Protect::ProtectedAttack::ProcessInput(), WsfGuidanceComputer::Phase::ProcessInput(), WsfMessageProcessor::Action::ProcessInput(), WsfMessageProcessor::Selector::ProcessInput(), ProcessInput(), WsfScriptStateMachine::Transition::ProcessInput(), and ~WsfScriptContext().

◆ CompileImplicitScript()

UtScript * WsfScriptContext::CompileImplicitScript ( UtInput & aInput,
const std::string & aName,
WsfStringId aReturnType )

Compile a implicit script and add it to the list of managed scripts. An 'implicit' script is one that is defined without using an explicit script/end_script block. Implicit scripts are things like 'on_update', 'on_initiate', 'next_state', etc. They take no arguments and the return type if defined implicitly.

Parameters
aInputThe input stream containing the script to be compiled.
aNameThe name of the implicit script.
aReturnTypeThe return type from the script ("void", "bool", etc.)
Returns
A pointer to the compiled script. An exception will be thrown if a compile error occurs.

References Compile().

Referenced by ProcessInput(), WsfWeaponEffects::ProcessInput(), and ~WsfScriptContext().

◆ CompileVariables()

void WsfScriptContext::CompileVariables ( UtInput & aInput)

Compiles the variable list, which may be any combination of variable declarations and assignments.

Parameters
aInputThe input stream containing the script.
Exceptions
Anexception if a compile error occurs.

References Compile().

Referenced by ProcessInput(), and ~WsfScriptContext().

◆ DeclareVariable()

void WsfScriptContext::DeclareVariable ( WsfStringId aType,
const std::string & aName )

Declare a variable in the script context if it already hasn't been declared.

Parameters
aTypeThe variable type.
aNameThe name of the variable.
Returns
Returns the variable's memory address (-1 if unsuccessful).

References mContextPtr.

Referenced by IADSC2ScenarioExtension::AddedToScenario(), and ~WsfScriptContext().

◆ ExecuteScript() [1/6]

void WsfScriptContext::ExecuteScript ( double aSimTime,
UtScript * aScriptPtr )

Execute a script.

Parameters
aSimTimeThe current simulation time.
aScriptPtrThe pointer to the script to execute.

References CallScript().

◆ ExecuteScript() [2/6]

void WsfScriptContext::ExecuteScript ( double aSimTime,
UtScript * aScriptPtr,
UtScriptData & aScriptRetVal,
const UtScriptDataList & aScriptArgs )

Execute a script.

Parameters
aSimTimeThe current simulation time.
aScriptPtrThe pointer to the script to execute.
aScriptRetValThe return value from the script.
aScriptArgsThe arguments to be passed to script.

References CallScript().

◆ ExecuteScript() [3/6]

bool WsfScriptContext::ExecuteScript ( double aSimTime,
UtScriptData & aScriptRetVal,
const UtScriptDataList & aScriptArgs,
const std::string & aScriptSource )

Execute a script

Parameters
aSimTimeThe current simulation time.
aScriptRetValThe return value from the script.
aScriptArgsThe arguments to be passed to script.
aScriptSourceThe source of the script in the format: <return-type> <name>(<arg-list>) ... script commands ... end_script

References CallScript(), Compile(), and mContextPtr.

◆ ExecuteScript() [4/6]

bool WsfScriptContext::ExecuteScript ( double aSimTime,
WsfStringId aScriptName )

Execute a script.

Parameters
aSimTimeThe current simulation time.
aScriptNameThe name of the script to be executed.
Returns
true if successful (i.e.: the requested script was defined) or false if the if the requested script was not defined.

References CallScript(), mContextPtr, and success.

Referenced by WsfSimulation::AddInputPlatforms(), WsfSA_Perceive::AssetScore(), WsfSA_Assess::CalculateDefensiveness(), WsfSA_Assess::CalculateRisk(), WsfSA_Assess::CalculateUrgency(), WsfGuidedMoverBase::CallStagingEventScript(), WsfInterceptCalculator::CanIntercept(), checkDownCommandChain(), checkDownCommandChain(), checkUpCommandChain(), checkUpCommandChain(), WsfScriptStateMachine::Transition::Evaluate(), WsfScriptEvent::Execute(), WsfSA_Assess::ExecuteCalculateDefensiveness(), WsfSA_Assess::ExecuteCalculateEntityTargetValue(), WsfSA_Assess::ExecuteCalculateEntityThreatLevel(), WsfSA_Assess::ExecuteCalculateFlightRisk(), WsfSA_Assess::ExecuteCalculateGroupTargetValue(), WsfSA_Assess::ExecuteCalculateGroupThreatLevel(), WsfSA_Assess::ExecuteCalculateMissileTargetValue(), WsfSA_Assess::ExecuteCalculateMissileThreatLevel(), WsfSA_Assess::ExecuteCalculateMissionRisk(), WsfSA_Assess::ExecuteCalculatePackageRisk(), WsfSA_Assess::ExecuteCalculateRisk(), WsfSA_Assess::ExecuteCalculateSelfRisk(), WsfSA_Assess::ExecuteCalculateUrgency(), WsfSA_Assess::ExecuteCalcWeaponSupport(), WsfGuidanceComputer::Phase::ExecuteOnEntry(), WsfGuidanceComputer::Phase::ExecuteOnExit(), WsfGuidanceComputer::Phase::ExecuteOnUpdate(), WsfBMTrackScriptLocalHandler::Invoke(), WsfBMTrackScriptRemoteHandler::Invoke(), WsfMessageProcessor::Selector::Matches(), WsfWeaponEffects::ProcessEffectCommon(), WsfSA_Predict::ProjectPositionForward(), WsfSA_Predict::ProjectPositionGoToPoint(), WsfSA_Predict::ProjectPositionInTime(), WsfSA_Predict::ProjectPositionLevelTurn(), WsfSA_Predict::ProjectPositionRollAndPull(), WsfSA_Predict::ProjectPositionRollAndPull(), WsfSA_Predict::ProjectPositionSplitS(), WsfSA_Predict::ProjectPositionTurnToHeading(), WsfSA_Perceive::Prune(), WsfRIPRProcessor::QueryBid(), WsfSA_Perceive::ThreatScore(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), and ~WsfScriptContext().

◆ ExecuteScript() [5/6]

bool WsfScriptContext::ExecuteScript ( double aSimTime,
WsfStringId aScriptName,
UtScriptData & aScriptRetVal,
const UtScriptDataList & aScriptArgs )

Execute a script.

Parameters
aSimTimeThe current simulation time.
aScriptNameThe name of the script to be executed.
aScriptRetValThe return value from the script.
aScriptArgsThe arguments to be passed to script.
Returns
true if successful (i.e.: the requested script was defined) or false if the if the requested script was not defined.

References CallScript(), FindScript(), and success.

◆ ExecuteScript() [6/6]

void WsfScriptContext::ExecuteScript ( UtScript * aScriptPtr,
UtScriptData & aScriptRetVal,
const UtScriptDataList & aScriptArgs )

Execute a script, using the current definition of the simulation time. This form is called by classes such as WsfScriptMessageHandler and WsfScriptStateMachine which have already set the simulation time. This avoids having to reset it.

Parameters
aScriptPtrThe pointer to the script to execute.
aScriptRetValThe return value from the script.
aScriptArgsThe arguments to be passed to script.

References CallScript().

◆ FindScript()

◆ GetClass() [1/3]

UtScriptClass * WsfScriptContext::GetClass ( const char * aClassName) const

Return a pointer to the script class object given its class name.

References GetClass().

◆ GetClass() [2/3]

◆ GetClass() [3/3]

UtScriptClass * WsfScriptContext::GetClass ( WsfStringId aClassName) const

Return a pointer to the script class object given its class name (ID).

References mContextPtr.

◆ GetContext()

◆ GetEnvironment()

UtScriptEnvironment * WsfScriptContext::GetEnvironment ( ) const

Return a pointer to the UtScriptEnvironment object.

References mContextPtr.

Referenced by ValidateScript(), WsfScriptContext(), and WsfScriptContext().

◆ GetEVENTPIPE()

WsfEventPipeInterface * WsfScriptContext::GetEVENTPIPE ( const UtScriptContext & aContext)
static

◆ GetExecutor()

◆ GetGlobalContext()

WsfScriptContext & WsfScriptContext::GetGlobalContext ( )

References mParentPtr, and WsfScriptContext().

Referenced by AddTimedEvents().

◆ GetMESSAGE()

WsfMessage * WsfScriptContext::GetMESSAGE ( const UtScriptContext & aContext)
static

A helper method, which simplifies the process of extracting the value stored in the 'MESSAGE' variable.

Parameters
aContextThe script context that contains the 'MESSAGE' variable.
Returns
Returns a pointer to the current processor stored in 'MESSAGE'.

◆ GetPart()

WsfPlatformPart * WsfScriptContext::GetPart ( )
inline

References mPlatformPartPtr.

◆ GetPLATFORM()

◆ GetPROCESSOR()

WsfProcessor * WsfScriptContext::GetPROCESSOR ( const UtScriptContext & aContext)
static

A helper method, which simplifies the process of extracting the value stored in the 'PROCESSOR' variable.

Parameters
aContextThe script context that contains the 'PROCESSOR' variable.
Returns
Returns a pointer to the current processor stored in 'PROCESSOR'.

Referenced by WsfBMTrackScriptCallbackHandler::Initialize(), WsfInterceptCalculator::Initialize(), and WsfVariableBase::ResolveReference().

◆ GetSCENARIO()

WsfScenario * WsfScriptContext::GetSCENARIO ( const UtScriptContext & aContext)
static

Referenced by WsfScriptAssetManagerClass::Create(), WsfScriptAssetMapClass::Create(), WsfScriptBattleManagerClass::Create(), WsfScriptBMAssetRecordClass::Create(), WsfScriptBMAssignmentStatusClass::Create(), WsfScriptBMEvalAssignmentClass::Create(), WsfScriptBMStatusMessageClass::Create(), WsfScriptBrawlerProcessorClass::Create(), WsfScriptDisseminateC2Class::Create(), WsfScriptOrbitalConjunctionProcessor::Create(), WsfScriptOrbitalDynamics::Create(), WsfScriptPerceptionProcessor::Create(), WsfScriptQuantumTaskerProcessor::Create(), WsfScriptRIPRProcessorClass::Create(), WsfScriptSA_ProcessorClass::Create(), WsfScriptSensorsManagerClass::Create(), WsfScriptSensorsManagerFovClass::Create(), WsfScriptSimpleSensorsManagerClass::Create(), WsfScriptUnclassAssetManagerClass::Create(), WsfScriptUnclassBattleManagerClass::Create(), WsfScriptUnclassDisseminateC2Class::Create(), WsfScriptUplinkProcessor::Create(), WsfScriptWeaponsManagerAIClass::Create(), WsfScriptWeaponsManagerClass::Create(), WsfScriptWeaponsManagerSAMClass::Create(), WsfScriptWeaponThreatProcessorClass::Create(), GetScenario(), WsfVariableBase::ResolveReference(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD_NO_ARG_CHECK(), UT_DEFINE_SCRIPT_METHOD_NO_ARG_CHECK(), UT_DEFINE_SCRIPT_METHOD_NO_ARG_CHECK(), UT_DEFINE_SCRIPT_METHOD_NO_ARG_CHECK(), UT_DEFINE_SCRIPT_METHOD_NO_ARG_CHECK(), and UT_DEFINE_SCRIPT_METHOD_NO_ARG_CHECK().

◆ GetScenario()

const WsfScenario * WsfScriptContext::GetScenario ( ) const

◆ GetSimTimeP()

UtScriptData WsfScriptContext::GetSimTimeP ( )
protected

References mSimulationPtr.

Referenced by CallScript().

◆ GetSIMULATION()

WsfSimulation * WsfScriptContext::GetSIMULATION ( const UtScriptContext & aContext)
static

Referenced by WsfInterceptCalculator::CanIntercept(), WsfInterceptCalculator::CanIntercept(), WsfScriptAssetMessageClass::Create(), WsfScriptBMAssignmentMessageClass::Create(), WsfScriptBMAssignmentTrackMessageClass::Create(), WsfScriptBMCueMessageClass::Create(), WsfScriptBMTrackMessageClass::Create(), WsfScriptMessageClass::Create(), WsfScriptNASA_BreakupModel::Create(), WsfScriptRouteFinderClass::Create(), WsfScriptSA_EntityMessage::Create(), WsfScriptTerrainClass::Create(), WsfScriptTrackClass::Create(), WsfScriptZoneRouteFinderClass::Create(), WsfBMTrackScriptLocalHandler::Invoke(), WsfBMTrackScriptRemoteHandler::Invoke(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), and wsf::cyber::UT_DEFINE_SCRIPT_METHOD().

◆ GetSimulation()

◆ GetTIME_NOW()

double WsfScriptContext::GetTIME_NOW ( const UtScriptContext & aContext)
static

A helper method, which simplifies the process of extracting the value stored in the 'TIME_NOW' variable.

Referenced by WsfScriptTrackClass::Create(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), and WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT().

◆ GetTRACK()

WsfTrack * WsfScriptContext::GetTRACK ( const UtScriptContext & aContext)
static

A helper method, which simplifies the process of extracting the value stored in the 'TRACK' variable.

Parameters
aContextThe script context that contains the 'TRACK' variable.
Returns
Returns a pointer to the current processor stored in 'TRACK'.

References trackPtr.

◆ GetTypes()

◆ HasUpdateHandler()

bool WsfScriptContext::HasUpdateHandler ( ) const
inline

Return 'true' if an 'on_update' script is defined.

References mOnUpdateScriptPtr.

◆ Initialize() [1/3]

bool WsfScriptContext::Initialize ( double aSimTime,
WsfPlatform * aPlatformPtr,
WsfPlatformPart * aPartPtr )
virtual

Initialize the script context. This method performs all the necessary initialization of the script system and

  • Sets the PLATFORM script variable.
  • Sets the PROCESSOR (or whatever platform part) script variable (if not at the platform level).
  • Sets the TIME_NOW script variable.
  • Invokes the 'on_initialize' method if it is defined.
    Parameters
    aSimTimeThe current simulation time.
    aPlatformPtrThe pointer to the platform with which the script context is associated.
    aPartPtrThe pointer to the platform part with which the script context is associated. This must be zero if the script context is associated with the platform.
    Returns
    'true' if successful or 'false' if there was some error.

References AddTimedEvents(), CallScript(), FindScript(), GetExecutor(), WsfSimulation::GetScriptContext(), WsfPlatform::GetSimulation(), mContextPtr, mOnUpdateScriptPtr, mParentPtr, mPartClassName, mPartVarName, mPlatformPartPtr, mPlatformPtr, mScriptCallTrace, mSimulationPtr, mUserDefinedScriptCallTrace, and ok.

Referenced by WsfBehaviorTree::Initialize(), Initialize(), and ~WsfScriptContext().

◆ Initialize() [2/3]

bool WsfScriptContext::Initialize ( double aSimTime,
WsfScriptContext & aParentContext,
void * aObjectPtr )
virtual

◆ Initialize() [3/3]

bool WsfScriptContext::Initialize ( WsfSimulation & aSimulation,
void * aObjectPtr )
virtual

Initialize the script context for a non-platform oriented object. This method performs all the necessary initialization of the script system and

  • Sets the TIME_NOW script variable.
  • Invokes the 'on_initialize' method if it is defined.
    Parameters
    aSimulationThe simulation .
    aObjectPtrThe pointer to the object with which the script context is associated.
    Returns
    'true' if successful or 'false' if there was some error.

References WsfSimulation::GetScriptContext(), WsfSimulation::GetSimTime(), and Initialize().

◆ Initialize2()

bool WsfScriptContext::Initialize2 ( double aSimTime)
virtual

Perform phase 2 initialization. This currently only invokes the 'on_initialize2' script if it is defined.

Parameters
aSimTimeThe current simulation time.
Returns
'true' if successful or 'false' if there was some error.

References CallScript(), and FindScript().

Referenced by ~WsfScriptContext().

◆ InitializeGlobalContext()

bool WsfScriptContext::InitializeGlobalContext ( WsfSimulation & aSimulation)
virtual

◆ operator=()

◆ PostCompile()

void WsfScriptContext::PostCompile ( UtInput & aInput,
UtScript * aRawScriptPtr )
protected

Perform common operations after attempted compilation.

References mScriptCheckError, mScriptExpectError, mScriptPrintCode, and WriteErrorHeader().

Referenced by Compile(), and Compile().

◆ ProcessInput()

bool WsfScriptContext::ProcessInput ( UtInput & aInput)
virtual

Determine if the current input command is a script-related command.

Parameters
aInputThe input stream.
Returns
'true' if the command was script-related or 'false' if not.

References Compile(), CompileImplicitScript(), CompileVariables(), mContextPtr, mScriptCallTrace, mScriptCheckError, mScriptExpectError, mScriptPrintCode, mTimedEvents, mUserDefinedScriptCallTrace, WsfVariable< T >::ReadValueOfType(), and WsfVariable< T >::ValueGreater().

Referenced by ~WsfScriptContext().

◆ SetParent() [1/2]

void WsfScriptContext::SetParent ( UtScriptContext * aParentPtr)

Set the parent script context.

Parameters
aParentPtrThe desired parent context for this context.

References mContextPtr.

◆ SetParent() [2/2]

void WsfScriptContext::SetParent ( WsfScriptContext * aParentPtr)

Set the parent script context.

Parameters
aParentPtrThe desired parent context for this context.

References mContextPtr, and WsfScriptContext().

Referenced by WsfAdvancedBehaviorTree::Initialize(), Initialize(), and WsfScriptContext().

◆ Update()

void WsfScriptContext::Update ( double aSimTime)
virtual

Invoke the 'on_update' script if it is defined.

References CallScript(), mOnUpdateScriptPtr, and mPlatformPtr.

◆ ValidateScript()

bool WsfScriptContext::ValidateScript ( UtScript * aScriptPtr,
WsfStringId aExpectedReturnType,
const std::string & aExpectedArgumentTypes ) const

Validate the script return type and argument list against the expected values.

Parameters
aScriptPtrThe point to the script that is to be checked. If this is zero then nothing is compared and true is returned.
aExpectedReturnTypeThe expected return type.
aExpectedArgumentTypesThe expected argument types as a comma-separated list.
Returns
true if the expected values and actual values match (or if the script pointer was zero). 'false' if any of the actual values do not match their expected value.

References GetEnvironment(), and WriteErrorHeader().

Referenced by WsfSimulation::AddInputPlatforms(), WsfInterceptCalculator::GetInterceptCalculator(), WsfBMTrackScriptCallbackHandler::Initialize(), WsfSA_Assess::Initialize(), WsfSA_Perceive::Initialize(), WsfSA_Predict::Initialize(), WsfWeaponEffects::ProcessEffectCommon(), wsf::cyber::Protect::ProtectedAttack::ProcessInput(), WsfQuantumAllocatorScript::WsfQuantumAllocatorScript(), WsfQuantumEvaluatorScript::WsfQuantumEvaluatorScript(), and WsfQuantumGeneratorScript::WsfQuantumGeneratorScript().

◆ WriteErrorHeader()

void WsfScriptContext::WriteErrorHeader ( UtScript * aScriptPtr) const
protected

References mPlatformPartPtr, and mPlatformPtr.

Referenced by PostCompile(), and ValidateScript().

Member Data Documentation

◆ mContextPtr

◆ mObjectClassName

WsfStringId WsfScriptContext::mObjectClassName {}
protected

The class name for a non-platform oriented object.

Referenced by Initialize(), operator=(), WsfScriptContext(), and WsfScriptContext().

◆ mOnUpdateScriptPtr

UtScript* WsfScriptContext::mOnUpdateScriptPtr {nullptr}
protected

A captured pointer to the on_update script (if it exists). It will also be in the 'mScripts' lists. (NOT for the global context).

Referenced by HasUpdateHandler(), Initialize(), operator=(), Update(), and WsfScriptContext().

◆ mParentPtr

WsfScriptContext* WsfScriptContext::mParentPtr {nullptr}
protected

Pointer to my immediate parent WsfScriptContext (nullptr if the global context).

Referenced by GetGlobalContext(), Initialize(), operator=(), and WsfScriptContext().

◆ mPartClassName

WsfStringId WsfScriptContext::mPartClassName {}
protected

The platform part class name.

Referenced by Initialize(), operator=(), WsfScriptContext(), and WsfScriptContext().

◆ mPartVarName

WsfStringId WsfScriptContext::mPartVarName {}
protected

The platform part variable name.

Referenced by Initialize(), operator=(), WsfScriptContext(), and WsfScriptContext().

◆ mPlatformPartPtr

WsfPlatformPart* WsfScriptContext::mPlatformPartPtr {nullptr}
protected

If the context is for a platform part, this is its pointer.

Referenced by AddTimedEvents(), CallScript(), GetPart(), Initialize(), operator=(), WriteErrorHeader(), and WsfScriptContext().

◆ mPlatformPtr

WsfPlatform* WsfScriptContext::mPlatformPtr {nullptr}
protected

If not the global context, this is the pointer to the associated platform.

Referenced by AddTimedEvents(), CallScript(), Initialize(), operator=(), Update(), WriteErrorHeader(), and WsfScriptContext().

◆ mScriptCallTrace

bool WsfScriptContext::mScriptCallTrace {false}
protected

'true' if call tracing is enabled.

Referenced by CallScript(), Initialize(), Initialize(), operator=(), ProcessInput(), and WsfScriptContext().

◆ mScriptCheckError

bool WsfScriptContext::mScriptCheckError {false}
protected

'true' if 'script_expect_error' is specified. Note that error checking is a 'one-shot' operation and is valid only for the next call to Compile. It is reset to false upon completion of the call.

Referenced by operator=(), PostCompile(), ProcessInput(), and WsfScriptContext().

◆ mScriptExpectError

bool WsfScriptContext::mScriptExpectError {false}
protected

The value of 'script_expect_error'.

Referenced by operator=(), PostCompile(), ProcessInput(), and WsfScriptContext().

◆ mScriptPrintCode

bool WsfScriptContext::mScriptPrintCode {false}
protected

'true' if script_print_code is enabled (prints the generated code after compiled)

Referenced by operator=(), PostCompile(), ProcessInput(), and WsfScriptContext().

◆ mSimulationPtr

WsfSimulation* WsfScriptContext::mSimulationPtr {nullptr}
protected

◆ mTimedEvents

std::vector<TimedEvent> WsfScriptContext::mTimedEvents
protected

◆ mTimeNowFunctionPtr

std::unique_ptr<ReadTIME_NOW> WsfScriptContext::mTimeNowFunctionPtr
protected

◆ mUserDefinedScriptCallTrace

bool WsfScriptContext::mUserDefinedScriptCallTrace {false}
protected

'true' if the user defined a value for script_call_trace

Referenced by Initialize(), Initialize(), operator=(), ProcessInput(), and WsfScriptContext().


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