Go to the documentation of this file.
12 #ifndef RTCTK_COMPONENTFRAMEWORK_RTCCOMPONENT_HPP
13 #define RTCTK_COMPONENTFRAMEWORK_RTCCOMPONENT_HPP
23 UseInitialising<Enabled>,
25 UseDisabling<Enabled>>;
88 if(
auto eptr = GetPayloadNothrow<events::UpdateError>(c); eptr) {
100 auto req = GetPayloadNothrow<events::Update>(c);
101 if (req ==
nullptr) {
105 std::string args = req->GetRequestPayload();
110 if (act_state.find(s) != std::string::npos) {
117 engine.
RegisterGuard(
"GuardDisablingAllowed", [
this](
auto c) {
120 if (act_state.find(s) != std::string::npos) {
150 const std::string parent_region =
"On.Operational.RegionUpdate";
157 this->
mm.
AddState(
Simple,
"On.Operational.UpdateBusy", parent_region ,
"ActivityUpdating" ,
"ActionUpdatingEntry");
159 this->
mm.
AddTrans(
"On.Operational.UpdateInitial" ,
"On.Operational.UpdateIdle" );
160 this->
mm.
AddTrans(
"On.Operational.UpdateIdle" ,
"On.Operational.UpdateBusy" ,
"events.Update",
"GuardUpdatingAllowed");
161 this->
mm.
AddTrans(
"On.Operational.UpdateBusy" ,
"On.Operational.UpdateIdle" ,
"events.UpdateDone",
"" ,
"ActionUpdatingDone" );
162 this->
mm.
AddTrans(
"On.Operational.UpdateBusy" ,
"On.Operational.UpdateIdle" ,
"events.UpdateError",
"" ,
"ActionUpdatingFailed" );
164 this->
mm.
ModTransGuard(
"On.Operational",
"On.NotOperational.Disabling",
"events.Disable",
"",
"GuardDisablingAllowed");
171 #endif // RTCTK_COMPONENTFRAMEWORK_RTCCOMPONENT_HPP
Definition: rtcComponent.hpp:35
@ Simple
Definition: model.hpp:23
Definition: stdComponent.hpp:52
Definition: rtcComponent.hpp:55
void ModTransGuard(std::string const &source_id, std::string const &target_id, std::string const &event_id, std::string const &guard_id, std::string const &new_guard_id)
Modifies the guard of a transition.
Definition: modelManipulator.cpp:295
@ Parallel
Definition: model.hpp:24
Basic life cycle for RtcComponent.
Definition: rtcComponent.hpp:32
void AddTrans(std::string const &source_id, std::string const &target_id, std::string const &event_id="", std::string const &guard_id="", std::string const &action_id="")
Adds a new transition.
Definition: modelManipulator.cpp:227
ModelBuilder(StateMachineEngine &engine)
Definition: rtcComponent.hpp:147
ModelManipulator mm
Definition: modelBuilderBase.hpp:86
std::function< void(std::exception_ptr)> m_update_error_handler
Definition: rtcComponent.hpp:140
void ModStateType(std::string const &state_id, StateType new_state_type)
Modifies type of state.
Definition: modelManipulator.cpp:122
Definition: commandReplier.cpp:20
Implementation of MAL commands for layer 'RtcComponent'.
void RegisterGuard(std::string const &id, GuardMethod guard)
Register guard.
Definition: stateMachineEngine.cpp:74
const std::string STD_OK_REPLY
Definition: stdComponent.hpp:36
rad::StopToken StopToken
Definition: stopToken.hpp:19
Definition: stateMachineEngine.hpp:31
Basic life cycle for StdComponent.
Definition: stdComponent.hpp:91
Adapter object intended to be used in contexts without direct access to the output-stream object.
Definition: exceptions.hpp:157
void RegisterAction(std::string const &id, ActionMethod action)
Register action.
Definition: stateMachineEngine.cpp:62
std::shared_ptr< rad::cii::Request< std::string, std::string > > m_tmp_update_request
Definition: rtcComponent.hpp:138
std::list< std::string > m_no_disable_in_states
Definition: rtcComponent.hpp:142
std::string Payload
Definition: payload.hpp:19
std::function< void()> m_update_success_handler
Definition: rtcComponent.hpp:139
StateMachineEngine & m_engine
Definition: stdComponent.hpp:382
std::string Str() const
Convenience function for constructing a std::string from the exception.
Definition: exceptions.hpp:175
virtual void ActivityUpdating(StopToken st, Payload args)
Definition: rtcComponent.hpp:37
void RegisterRejectHandler(std::string const &id, RejectMethod reject)
Register reject handler.
Definition: stateMachineEngine.cpp:95
void AddState(StateType type, std::string const &id, std::string const &parent_id="", std::string const &activity_id="", std::string const &entry_action_id="", std::string const &exit_action_id="")
Adds a new state.
Definition: modelManipulator.cpp:29
void RegisterLayer(Layer layer)
Definition: modelBuilderBase.hpp:74
Lifecycle of the 'Standard Component'.
@ Initial
Definition: model.hpp:26
Definition: stdComponent.hpp:108
virtual bool GuardUpdatingAllowed(Payload args)
Definition: rtcComponent.hpp:39
Definition: stdComponent.hpp:389
StdComponent< UseStarting< Enabled >, UseInitialising< Enabled >, UseEnabling< Enabled >, UseDisabling< Enabled > > RtcComponentSuper
Definition: rtcComponent.hpp:25
Definition: stdComponent.hpp:65
Definition: rtcComponent.hpp:145
OutputStage(StateMachineEngine &engine, BizLogicIf &bl)
Definition: rtcComponent.hpp:57
std::string GetState()
Queries the current state.
Definition: stateMachineEngine.cpp:126
std::list< std::string > m_no_update_in_states
Definition: rtcComponent.hpp:141
Definition: stdComponent.hpp:129
BizLogicIf & m_logic
Definition: stdComponent.hpp:383
Defines an agnostic payload type based on std::string.
static void Register(CommandReplier &replier, StateMachineEngine &engine)
Definition: rtcCmdsImpl.hpp:66
void PostEvent(rad::SharedEvent s)
Injects a new event into the state machine engine.
Definition: stateMachineEngine.cpp:121
@ Composite
Definition: model.hpp:25
void RegisterActivity(std::string const &id, ActivityMethod activity, SuccessMethod on_success, FailureMethod on_failure)
Register activity.
Definition: stateMachineEngine.cpp:87