OTX-Runtime for C++  
OpenTestSystem::Otx::Runtime::Api::IRuntimeContext Class Referenceabstract

Contains information of a Runner instance. More...

#include <IRuntimeContext.h>

Public Member Functions

virtual void Continue ()=0
 An explicit paused runtime context (not implicit) continues its execution with the next activity. More...
 
virtual ExecutionState GetExecutionState () const =0
 Gets ExecutionState of the runtime context. More...
 
virtual long long GetExecutionTime ()=0
 Get the total time of procedure execution in milliseconds. The value is the time where the procedure execution is inside @ ExecutionState.Running . The time inside other states e.g. @ ExecutionState.Paused @ shall not be counted. Getting the value shall deliver the current value. More...
 
virtual std::string GetName () const =0
 Gets name of RuntimeContext. More...
 
virtual Exceptions::OtxException const & GetOtxException () const =0
 Gets an OTX exception which is not handled inside OTX execution. More...
 
virtual std::shared_ptr< Otx::IProcedureGetProcedure () const =0
 Gets Procedure which created this RuntimeContext by starting an execution. More...
 
virtual long long GetProcessId ()=0
 Get the process Id of the runner process. The PID will only delivered if the @ ExecutionState @ is @ Running @ or @ Paused . In all other @ ExecutionState @ s -1 is returned. More...
 
virtual long long GetProcessMemory ()=0
 Get the number of private bytes of the runner process. The value will be calculated inside the runner at the time the property is read. After the procedure execution is finished the value contains the number of private bytes direct before the ProcedureFinished event. If the OTX runtime is inside the application process (RAW mode), the number of private bytes of the application process will be returned. More...
 
virtual std::exception const & GetRuntimeException () const =0
 Gets an runtime exception which was thrown by OTX-Runtime due to a bug. More...
 
virtual long long GetRuntimeId () const =0
 Gets an unique id of the procedure execution context. More...
 
virtual bool HasOtxException () const =0
 Checks if the execution was terminated by an OTX Exception. More...
 
virtual bool HasRuntimeException () const =0
 Checks if the execution was terminated by an Exception. More...
 
virtual void Pause ()=0
 The runtime context pause its execution. This means that all executing procedures will execute their current atomic node and then pause the execution until it is continued or stopped. More...
 
virtual void Stop ()=0
 Changes the execution state of the runtime context immediately to Stopped. The execution completely stops when the ProcedureStopped event fires. More...
 

Detailed Description

Contains information of a Runner instance.

For each executed procedure a new Runner instance will be started and after finishing the execution the Runner instance will be deleted. A Runner can be executed inside an own process or inside the process of the application, see RuntimeManagerFactory. A RuntimeContext represents a Runner instance. It is unique and will be created at procedure execution, see Execute.

The RuntimeContext represents a project, see Project. The project can get via Procedure, Document and Package. Please note, that a player project can contain more than one project, see PlayerProject and each of this projects can have different project settings, see ProjectSettings.

Member Function Documentation

◆ Continue()

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::Continue ( )
pure virtual

An explicit paused runtime context (not implicit) continues its execution with the next activity.

Exceptions
Exceptions.RuntimeExceptionThrows a RuntimeException if the runtime context cannot be continued.

◆ GetExecutionState()

virtual ExecutionState OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::GetExecutionState ( ) const
pure virtual

Gets ExecutionState of the runtime context.

Returns
The ExecutionState of the runtime context.

◆ GetExecutionTime()

virtual long long OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::GetExecutionTime ( )
pure virtual

Get the total time of procedure execution in milliseconds. The value is the time where the procedure execution is inside @ ExecutionState.Running . The time inside other states e.g. @ ExecutionState.Paused @ shall not be counted. Getting the value shall deliver the current value.

Returns
Execution duration in milliseconds.

◆ GetName()

virtual std::string OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::GetName ( ) const
pure virtual

Gets name of RuntimeContext.

The name can be used to better distinguish the different OTX runners and/or clients of DiagManager inside the trace files. It can be set via the Execute method.

Returns
Name of RuntimeContext.

◆ GetOtxException()

virtual Exceptions::OtxException const& OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::GetOtxException ( ) const
pure virtual

Gets an OTX exception which is not handled inside OTX execution.

Returns
OTX Exception which was thrown by OTX-Runtime.

◆ GetProcedure()

virtual std::shared_ptr<Otx::IProcedure> OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::GetProcedure ( ) const
pure virtual

Gets Procedure which created this RuntimeContext by starting an execution.

Returns
Procedure which created this RuntimeContext.

◆ GetProcessId()

virtual long long OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::GetProcessId ( )
pure virtual

Get the process Id of the runner process. The PID will only delivered if the @ ExecutionState @ is @ Running @ or @ Paused . In all other @ ExecutionState @ s -1 is returned.

Returns
The PID of the runner process.

◆ GetProcessMemory()

virtual long long OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::GetProcessMemory ( )
pure virtual

Get the number of private bytes of the runner process. The value will be calculated inside the runner at the time the property is read. After the procedure execution is finished the value contains the number of private bytes direct before the ProcedureFinished event. If the OTX runtime is inside the application process (RAW mode), the number of private bytes of the application process will be returned.

Returns
Number of private bytes of the runner process.

◆ GetRuntimeException()

virtual std::exception const& OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::GetRuntimeException ( ) const
pure virtual

Gets an runtime exception which was thrown by OTX-Runtime due to a bug.

Returns
Exception which was thrown by OTX-Runtime.

◆ GetRuntimeId()

virtual long long OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::GetRuntimeId ( ) const
pure virtual

Gets an unique id of the procedure execution context.

Returns
An unique id of the procedure execution context.

◆ HasOtxException()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::HasOtxException ( ) const
pure virtual

Checks if the execution was terminated by an OTX Exception.

Returns
True there is OTX Exception; otherwise false.

◆ HasRuntimeException()

virtual bool OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::HasRuntimeException ( ) const
pure virtual

Checks if the execution was terminated by an Exception.

Returns
True there is OTX-Runtime Exception; otherwise false.

◆ Pause()

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::Pause ( )
pure virtual

The runtime context pause its execution. This means that all executing procedures will execute their current atomic node and then pause the execution until it is continued or stopped.

Exceptions
Exceptions.RuntimeExceptionThrows a RuntimeException if the runtime context cannot be paused.

◆ Stop()

virtual void OpenTestSystem::Otx::Runtime::Api::IRuntimeContext::Stop ( )
pure virtual

Changes the execution state of the runtime context immediately to Stopped. The execution completely stops when the ProcedureStopped event fires.

In Socket and Pipe mode, the runtime execution process is killed, and the ProcedureStopped event fires immediately.

In Raw mode, the runtime execution thread cannot be terminated immediately. It is signaled and may take some time to stop completely. After the execution of each activity in OTX workflow, it checks for the stop signal. The runtime execution is fully stopped when the ProcedureStopped event is fired.


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