25 #ifndef TASKOLIB_EXECUTOR_H_
26 #define TASKOLIB_EXECUTOR_H_
Declaration of the CommChannel struct.
Declaration of the Context and VariableValue types.
Declaration of the StepIndex type.
An executor runs a copy of a given Sequence (or just a single step within it) in a separate thread,...
Definition: Executor.h:70
Executor & operator=(Executor const &)=delete
std::future< VariableTable > future_
A future for the result of the execution thread.
Definition: Executor.h:172
Context context_
A local copy of the context that was used to start the last sequence.
Definition: Executor.h:179
bool is_busy()
Determine if the executor is currently running a sequence in a separate thread.
Definition: Executor.cc:88
~Executor()
Definition: Executor.h:81
Executor(Executor &&)=default
void cancel()
Terminate a running sequence.
Definition: Executor.cc:67
void run_single_step_asynchronously(Sequence &sequence, Context context, StepIndex step_index)
Start a single step of the given sequence in a separate thread.
Definition: Executor.cc:126
Executor(Executor const &)=delete
void run_asynchronously(Sequence &sequence, Context context)
Start a copy of the given sequence in a separate thread.
Definition: Executor.cc:121
Executor & operator=(Executor &&)=default
void launch_async_execution(Sequence &sequence, Context context, OptionalStepIndex step_index)
Start a sequence- or single-step-execution function in a separate thread.
Definition: Executor.cc:102
bool update(Sequence &sequence)
Update the local copy of the sequence from messages that have arrived from the execution thread.
Definition: Executor.cc:135
Executor()
Construct an Executor.
Definition: Executor.cc:62
VariableTable get_context_variables()
Retrieve the variables stored in the context.
Definition: Executor.h:155
std::shared_ptr< CommChannel > comm_channel_
Communications channel between the main thread and the executing thread.
Definition: Executor.h:165
A sequence of steps that can be modified and executed.
Definition: Sequence.h:160
Namespace task contains all Taskolib functions and classes.
Definition: CommChannel.h:33
std::uint16_t StepIndex
A type for storing the index of a Step in a Sequence.
Definition: StepIndex.h:34
gul14::optional< StepIndex > OptionalStepIndex
An optional step index (gul14::optional<StepIndex>).
Definition: StepIndex.h:37
std::unordered_map< VariableName, VariableValue > VariableTable
Associative table that holds Lua variable names and their value.
Definition: Context.h:80
A context stores information that influences the execution of steps and sequences,...
Definition: Context.h:128
VariableTable variables
A map of variables (names and values) that can be im-/exported into steps.
Definition: Context.h:130