|
xentara-cpp-control v1.1
The Xentara C++ Control Framework
|
An run context with execution information and is required for the read and write for Input and Output respectively. More...
#include <xentara/RunContext.hpp>
Public Member Functions | |
| RunContext ()=delete | |
| No default construction. | |
| auto | scheduledTimestamp () const -> std::chrono::system_clock::time_point |
| Gets the time the pipeline was scheduled for. | |
| auto | currentStage () const -> Stage |
| Gets the current stage of Xentara. | |
| auto | counter () const -> std::int64_t |
| Gets the execution counter of the trigger. | |
| auto | xentaraSkillElement () const &noexcept -> const skill::Element & |
| Gets the Xentara skill element. | |
| auto | reschedule (std::chrono::system_clock::time_point when) -> void |
| Sets a timer that raises the “rescheduled” event of the Xentara control element. | |
| RunContext (const RunContext &)=delete | |
| Delete the copy constructor. | |
| auto | operator= (const RunContext &) -> RunContext &=delete |
| Delete the assignment operator. | |
Error Handling | |
| auto | error () const -> std::error_code |
| Gets the error that occurred during read or write operations. | |
| auto | setError (std::error_code error) -> void |
| Sets the error code with the provided value. | |
| auto | resetError () -> void |
| Resets the error code. | |
An run context with execution information and is required for the read and write for Input and Output respectively.
An object of this class is passed to the callbacks of Control::step(), Control::enterPreOp(), Control::enterOperational(), Control::enterPostOp() and Control::final(). It provides information about the current execution, like the scheduled time, current stage and execution counter of the pipeline. This object is also passed to the Input::read() and Output::write() functions and provides errors information occurring during read and write operations. You never create objects of this class yourself. If you want to handle errors yourself, you can use the cleanRunContext() function to get your own RunContext for managing.
|
delete |
No default construction.
|
delete |
Delete the copy constructor.
| auto xentara::RunContext::counter | ( | ) | const -> std::int64_t |
Gets the execution counter of the trigger.
| auto xentara::RunContext::currentStage | ( | ) | const -> Stage |
Gets the current stage of Xentara.
| auto xentara::RunContext::error | ( | ) | const -> std::error_code |
Gets the error that occurred during read or write operations.
|
delete |
Delete the assignment operator.
Sets a timer that raises the “rescheduled” event of the Xentara control element.
This function can be used to reschedule the control to run at a specific time in the future. Once that time has arrived, the “rescheduled” event will be raised. In order for this to work as intended, the “rescheduled” event must be configured to trigger of an execution pipeline that contains the control’s “step” task.
The rescheduling timer is reset every time the control is executed. If the control runs before the scheduled time die to another timer or event, you must call reschedule() again.
Rescheduling a control can be useful to implement timers and delays.
| when | The time at which the “rescheduled” event should be raised. If the time is in the past, then the “rescheduled” event will be raised immediately. |
| auto xentara::RunContext::scheduledTimestamp | ( | ) | const -> std::chrono::system_clock::time_point |
Gets the time the pipeline was scheduled for.
| auto xentara::RunContext::setError | ( | std::error_code | error | ) | -> void |
Sets the error code with the provided value.
|
noexcept |
Gets the Xentara skill element.
This function gives access to the underlying Xentara control skill element.