|
DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Defines a task for deinitializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by a deinitialization task class derived from ExitTaskBase. Even if the task does not do anything, at least it has to call ExitTaskBase::ExitFuncImpl() of the derived instrument's deinitialization task class.
More...
#include <DataStreamInstrument.h>
Inheritance diagram for DynExpInstr::DataStreamInstrumentTasks::ExitTask:Private Member Functions | |
| void | ExitFuncImpl (dispatch_tag< ExitTaskBase >, DynExp::InstrumentInstance &Instance) override final |
| virtual void | ExitFuncImpl (dispatch_tag< ExitTask >, DynExp::InstrumentInstance &Instance) |
Deinitializes the respective instrument within the instrument inheritance hierarchy. Call ExitFuncImpl() of a derived instrument's exit task as the first command in a base instrument's exit task ExitFuncImpl() to ensure that derived instruments can shut down before base instruments. Overriding functions must throw an exception in case of an error. | |
Additional Inherited Members | |
Public Types inherited from DynExp::TaskBase | |
| enum class | TaskState { Waiting , Locked , Running , Finished , Failed , Aborted } |
| Defines states an instrument's task can undergo. Possible state transitions are: More... | |
Public Member Functions inherited from DynExp::TaskBase | |
| TaskBase (CallbackType CallbackFunc=nullptr, std::chrono::system_clock::time_point DeferUntil={}) noexcept | |
| Constructs an instrument task. | |
| TaskBase (TaskBase &Other, std::chrono::system_clock::time_point DeferUntil={}) noexcept | |
| Constructs an instrument task, moving CallbackFunc from another task to this task. The other task is left with a CallbackFunc that will not be executed anymore after this operation. Using this constructor is useful, if a running task enqueues (an)other task(s). In this case, the callback function should not be called by the original task but by the last task in this chain of tasks. | |
| virtual | ~TaskBase ()=0 |
The destructor aborts a waiting task setting State to TaskState::Aborted. Then, it calls CallbackFunc with a default-constructed ExceptionContainer instance. | |
| auto | GetDeferUntil () const noexcept |
| Getter for the instrument task's earliest execution time point. | |
| TaskState | GetState () const noexcept |
| Getter for the instrument task's current state. | |
| bool | IsLocked () const noexcept |
| Determines whether the task is locked. | |
| bool | IsAborting () const noexcept |
| Determines whether the task should abort. A derived task is encouraged to call this method before performing any action or in between the individual steps of a more complex action. | |
| int | GetErrorCode () const noexcept |
| Getter for the error code related to an error possibly occurred while the task was executed. | |
| void | Abort () |
Requests the task to abort. There is no guarantee that the derived task does call IsAborting() to check whether it should abort. The task could have finished already or the implementation of RunChild() in the derived class does not allow for aborting. | |
Public Attributes inherited from DynExp::TaskBase | |
| InstrumentBaseOnlyType | InstrumentBaseOnly |
Allow exclusive access to some of TaskBase's private methods to InstrumentBase. | |
| InstrumentDataBaseOnlyType | InstrumentDataBaseOnly |
Allow exclusive access to some of TaskBase's private methods to InstrumentDataBase. | |
Defines a task for deinitializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by a deinitialization task class derived from ExitTaskBase. Even if the task does not do anything, at least it has to call ExitTaskBase::ExitFuncImpl() of the derived instrument's deinitialization task class.
Definition at line 39 of file DataStreamInstrument.h.
|
inlineprivatevirtual |
Deinitializes the respective instrument within the instrument inheritance hierarchy. Call ExitFuncImpl() of a derived instrument's exit task as the first command in a base instrument's exit task ExitFuncImpl() to ensure that derived instruments can shut down before base instruments. Overriding functions must throw an exception in case of an error.
| Instance | Handle to the instrument thread's data |
Reimplemented in DynExpInstr::FunctionGeneratorTasks::ExitTask, DynExpInstr::InputPortTasks::ExitTask, DynExpInstr::LockinAmplifierTasks::ExitTask, and DynExpInstr::TimeTaggerTasks::ExitTask.
Definition at line 46 of file DataStreamInstrument.h.
|
inlinefinaloverrideprivate |
Definition at line 41 of file DataStreamInstrument.h.