13#ifndef RTCTK_COMPONENTFRAMEWORK_SUSPENDABLE_HPP
14#define RTCTK_COMPONENTFRAMEWORK_SUSPENDABLE_HPP
28template <
typename Super>
47 using Super::InputStage::InputStage;
50 Super::InputStage::Start();
69 this->m_no_disable_in_states.push_back(
"On::Operational::Suspending");
70 this->m_no_disable_in_states.push_back(
"On::Operational::Resuming");
71 this->m_no_disable_in_states.push_back(
"On::Operational::Suspended");
75 this->m_no_update_in_states.push_back(
"On::Operational::Suspending");
76 this->m_no_update_in_states.push_back(
"On::Operational::Resuming");
80 engine.RegisterAction(
"ActionSuspendingEntry", [
this](
auto c) {
84 engine.RegisterAction(
"ActionSuspendingDone", [
this](
auto c) {
85 if (this->m_tmp_request) {
87 this->m_tmp_request =
nullptr;
91 engine.RegisterAction(
"ActionResumingEntry", [
this](
auto c) {
95 engine.RegisterAction(
"ActionResumingDone", [
this](
auto c) {
96 if (this->m_tmp_request) {
98 this->m_tmp_request =
nullptr;
105 "ActivitySuspending",
109 this->m_success_handler,
110 this->m_error_handler);
117 this->m_success_handler,
118 this->m_error_handler);
126 this->m_error_handler);
137 std::string
parent_region = this->mm.GetParentId(
"On::Operational::Closed");
139 this->mm.AddState(
Simple,
"On::Operational::Suspended" ,
parent_region ,
"ActivitySuspended");
140 this->mm.AddState(
Simple,
"On::Operational::Suspending" ,
parent_region ,
"ActivitySuspending" ,
"ActionSuspendingEntry");
141 this->mm.AddState(
Simple,
"On::Operational::Resuming" ,
parent_region ,
"ActivityResuming" ,
"ActionResumingEntry" );
143 this->mm.AddTrans(
"On::Operational::Closed" ,
"On::Operational::Suspending" ,
"events.Suspend");
144 this->mm.AddTrans(
"On::Operational::Suspending" ,
"On::Operational::Suspended" ,
"events.Done",
"" ,
"ActionSuspendingDone");
145 this->mm.AddTrans(
"On::Operational::Suspended" ,
"On::Operational::Resuming" ,
"events.Resume");
146 this->mm.AddTrans(
"On::Operational::Resuming" ,
"On::Operational::Closed" ,
"events.Done",
"" ,
"ActionResumingDone");
147 this->mm.AddTrans(
"On::Operational::Suspended" ,
"On::Operational::Opening" ,
"events.Open");
Thrown if a command is not allowed in current state or guard.
Definition rtcComponent.hpp:40
Definition stateMachineEngine.hpp:35
static void Register(CommandReplier &replier, StateMachineEngine &engine)
Definition suspCmdsImpl.hpp:37
Definition suspendable.hpp:35
virtual void ActivityResuming(StopToken st)
Definition suspendable.hpp:38
virtual void ActivitySuspended(StopToken st)
Definition suspendable.hpp:39
virtual void ActivitySuspending(StopToken st)
Definition suspendable.hpp:37
Definition suspendable.hpp:133
ModelBuilder(StateMachineEngine &engine)
Definition suspendable.hpp:135
Definition suspendable.hpp:59
OutputStage(StateMachineEngine &engine, BizLogicIf &bl)
Definition suspendable.hpp:61
Lifecycle Extension that makes an RTC Component 'Loopaware'.
Definition commandReplier.cpp:22
@ Simple
Definition model.hpp:23
rad::StopToken StopToken
Definition stopToken.hpp:20
const std::string STD_OK_REPLY
Definition stdComponent.hpp:86
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Life cycle extension to make Loopaware RtcComponent Suspendable.
Definition suspendable.hpp:29
Implementation of MAL commands for layer 'Suspendable'.