rad 6.2.0
|
#include <executorActivity.hpp>
Public Member Functions | |
ExecutorActivity (const std::string &id, Executor ex, Func &&func) | |
ExecutorActivity (const ExecutorActivity &)=delete | |
ExecutorActivity & | operator= (const ExecutorActivity &)=delete |
Disable copy constructor. | |
void | start (scxml4cpp::Context *c) override |
Disable assignment operator. | |
void | stop (scxml4cpp::Context *c) override |
![]() | |
Activity (const std::string &id) | |
virtual | ~Activity () |
std::string | getId () const |
void | setId (const std::string &id) |
This class is the base class for boost ASIO (and compatible) executor do-activities.
scxml4cpp::stop()
) there needs to be a way to synchronously await the completion (as required by the scxml4cpp::Activity interface). This is an inherent friction in the transition between a synchronous API and an asynchronous API. This also carries a risk of deadlock if the same single-threaded executor is used to await the activity and to complete the stop of the activity. One possibility is to require the Run()
method to be synchronous as well, and will thus consume a whole thread from the executor.Func requirements:
Callable with signature void(Executor, StopToken)
Copyable.
|
inlineexplicit |
|
delete |
|
delete |
Disable copy constructor.
|
overridevirtual |
Disable assignment operator.
Start activity by invoking provided Func in provided Executor.
Implements scxml4cpp::start() and is invoked by state machine engine.
Implements scxml4cpp::Activity.
|
overridevirtual |
Stop activity. If activity is already completed it does nothing.
Implements scxml4cpp::stop() and is invoked by state machine engine.
Implements scxml4cpp::Activity.