Open 3D Engine ScriptCanvas Gem API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
ScriptCanvas::ExecutionStateHandler Class Referencefinal

#include <ExecutionStateHandler.h>

Public Member Functions

 AZ_TYPE_INFO (ExecutionStateHandler, "{02E0EB5F-B28E-4B95-9FF2-DEA42ECC575D}")
 
 AZ_CLASS_ALLOCATOR (ExecutionStateHandler, AZ::SystemAllocator)
 
 ~ExecutionStateHandler ()
 Clears the Executable on destruction if required.
 
void Execute ()
 
ExecutionMode GetExecutionMode () const
 
void Initialize (const RuntimeDataOverrides &overrides, ExecutionUserData &&userData=ExecutionUserData())
 
void InitializeAndExecute (const RuntimeDataOverrides &overrides, ExecutionUserData &&userData=ExecutionUserData())
 
bool IsExecutable () const
 
bool IsPure () const
 
void StopAndClearExecutable ()
 
void StopAndKeepExecutable ()
 

Protected Attributes

Execution::StateStorage m_executionStateStorage
 
ExecutionStatem_executionState = nullptr
 

Detailed Description

ExecutionStateHandler provides RAII semantics and an interface for the ExecutionStateStorage for ScriptCanvas graph. It and executes and stops the runtime graph, if possible.

Note
this is done WITHOUT any safety checks. For example, the the presence of a good, loaded asset is required when Execute() is called. If SC_RUNTIME_CHECKS_ENABLED is defined, the class will error on a bad asset, and early return if possible. In this class general attempts to eliminate any branching done in the interest of safety checks. All safety checks are expected be done by systems that own the Executor class. If safety checks are desired, consider using the Interpreter class instead, which manages the execution stack from source file -> build system -> execution.

Usage: 1) Initialize() 2) Execute() 3) <stop function>() 4) Optional (repeat steps 1-3), <stop function>() and Initialize() may be required to be called before subsequent calls to Execute();

Member Function Documentation

◆ Execute()

void ScriptCanvas::ExecutionStateHandler::Execute ( )

Executes if possible, fails an SC_RUNTIME_CHECK if not.

◆ Initialize()

void ScriptCanvas::ExecutionStateHandler::Initialize ( const RuntimeDataOverrides overrides,
ExecutionUserData &&  userData = ExecutionUserData() 
)

Initializes the runtime with the inputs, but does NOT execute.

◆ InitializeAndExecute()

void ScriptCanvas::ExecutionStateHandler::InitializeAndExecute ( const RuntimeDataOverrides overrides,
ExecutionUserData &&  userData = ExecutionUserData() 
)

Provides Initialize with the provided inputs and immediately executes.

◆ IsExecutable()

bool ScriptCanvas::ExecutionStateHandler::IsExecutable ( ) const

Returns true iff the object has been initialized with valid, executable data

◆ IsPure()

bool ScriptCanvas::ExecutionStateHandler::IsPure ( ) const

Returns true iff the user can reasonably call Execute() serially without calling a <stop function>() in between.

◆ StopAndClearExecutable()

void ScriptCanvas::ExecutionStateHandler::StopAndClearExecutable ( )

Stops Execution if possible, and destroys the runtime. The user must call Initialize() before Executing again.

◆ StopAndKeepExecutable()

void ScriptCanvas::ExecutionStateHandler::StopAndKeepExecutable ( )

Stops Execution if possible, and keeps the runtime, allowing the user to immediately call Execute() again.


The documentation for this class was generated from the following file: