xentara-plugin v1.2.1
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::process::ExecutionContext Class Referenceabstract

An execution context for executing a task. More...

#include <process/ExecutionContext.hpp>

Public Member Functions

virtual ~ExecutionContext ()=0
 Virtual destructor.
 
virtual auto scheduledTime () const noexcept -> std::chrono::system_clock::time_point=0
 Gets the time the pipeline was scheduled for.
 
virtual auto executionTime () const noexcept -> std::chrono::system_clock::time_point=0
 Gets the time the pipeline was executed.
 
virtual auto counter () const noexcept -> std::uint64_t=0
 Gets the execution counter of the trigger.
 

Detailed Description

An execution context for executing a task.

An object of this class is passed to the callbacks of tasks and provide access to some information about the current execution, like the execution time and execution counter of the pipeline.

See also
Execution Pipelines in the Xentara user manual

Constructor & Destructor Documentation

◆ ~ExecutionContext()

xentara::process::ExecutionContext::~ExecutionContext ( )
pure virtualdefault

Virtual destructor.

Member Function Documentation

◆ counter()

virtual auto xentara::process::ExecutionContext::counter ( ) const -> std::uint64_t
pure virtualnoexcept

Gets the execution counter of the trigger.

Returns
The number of times the trigger has been executed. On the first execution, 0 is returned.

◆ executionTime()

virtual auto xentara::process::ExecutionContext::executionTime ( ) const -> std::chrono::system_clock::time_point
pure virtualnoexcept

Gets the time the pipeline was executed.

Returns
The time the pipeline was actually executed. This may be after the scheduled time if the execution was delayed because another pipeline was still running.

◆ scheduledTime()

virtual auto xentara::process::ExecutionContext::scheduledTime ( ) const -> std::chrono::system_clock::time_point
pure virtualnoexcept

Gets the time the pipeline was scheduled for.

Returns
The time the pipeline was scheduled for. This is not the actual time at the time the function is called, but the time that the pipeline was initially intended to run. For timers, this is the time that the timer was scheduled to run, and for events, the time that the event occurred.