RTC Toolkit  1.0.0
stdComponent.hpp
Go to the documentation of this file.
1 
12 #ifndef RTCTK_COMPONENTFRAMEWORK_STDCOMPONENT_HPP
13 #define RTCTK_COMPONENTFRAMEWORK_STDCOMPONENT_HPP
14 
16 #include <rtctk/componentFramework/events.rad.hpp>
25 
26 #include <mal/Cii.hpp>
27 
28 #include <memory>
29 #include <string>
30 
31 namespace rtctk::componentFramework {
32 
34 
35 // this we reply over MAL for commands that succeeds
36 inline const std::string STD_OK_REPLY = "OK";
37 
39 
40 // High level excepiton types returned via MAL
41 
42 // somebody send a stop or abort command
43 class RequestAborted : public stdif::ExceptionErr {
44 public:
45  static constexpr int32_t ERROR_CODE = 11;
47  : stdif::ExceptionErr("Request aborted.", ERROR_CODE) {
48  }
49 };
50 
51 // command is not allowed in current state or guard
52 class RequestRejected : public stdif::ExceptionErr {
53 public:
57  static constexpr int32_t ERROR_CODE = 10;
58  RequestRejected(std::string const& request_id, std::string const& state_id)
59  : stdif::ExceptionErr("Request " + request_id + " rejected in state " + state_id,
60  ERROR_CODE) {
61  }
62 };
63 
64 // the command was accepted but the task to do failed
65 class RequestFailed : public stdif::ExceptionErr {
66 public:
70  static constexpr int32_t ERROR_CODE = 501;
71  RequestFailed(std::string const& message)
72  : stdif::ExceptionErr(message, ERROR_CODE) {
73  }
74 };
75 
77 RTCTK_DEFINE_OPTION(UseInitialising, Enabled);
80 
90 template <typename... Options>
91 struct StdComponent {
93  : RTCTK_APPLY_OPTION_ED(Options, UseStarting)
94  , RTCTK_APPLY_OPTION_ED(Options, UseInitialising)
95  , RTCTK_APPLY_OPTION_ED(Options, UseEnabling)
96  , RTCTK_APPLY_OPTION_ED(Options, UseDisabling) {
97  };
98 
99  RTCTK_ASSERT_OPTION_ED(UseStarting);
100  RTCTK_ASSERT_OPTION_ED(UseInitialising);
102  RTCTK_ASSERT_OPTION_ED(UseDisabling);
103 
105  : public optional_base<IStarting, RTCTK_IS_OPTION(UseStarting, Enabled)>
106  , public optional_base<IInitialising, RTCTK_IS_OPTION(UseInitialising, Enabled)>
107  , public optional_base<IEnabling, RTCTK_IS_OPTION(UseEnabling, Enabled)>
108  , public optional_base<IDisabling, RTCTK_IS_OPTION(UseDisabling, Enabled)> {
109  };
110 
111  class InputStage {
112  public:
114  : m_replier(replier), m_engine(engine) {
115  // TODO should this also inject the events from the singal handler, e.g. SIGTERM
116  }
117 
118  virtual ~InputStage() = default;
119 
120  virtual void Start() {
122  }
123 
124  protected:
127  };
128 
129  class OutputStage {
130  public:
131 
133  // Handlers ###################################################################
134 
135  engine.RegisterRejectHandler<events::Init, RequestRejected>();
136  engine.RegisterRejectHandler<events::Stop, RequestRejected>();
138  engine.RegisterRejectHandler<events::Enable, RequestRejected>();
139  engine.RegisterRejectHandler<events::Disable, RequestRejected>();
140  engine.RegisterRejectHandler<events::GetState, RequestRejected>();
141  engine.RegisterRejectHandler<events::Exit, RequestRejected>();
142 
143  m_success_handler = [this] { m_engine.PostEvent(std::make_unique<events::Done>()); };
144 
145  m_error_handler = [this](std::exception_ptr eptr) {
146  m_engine.PostEvent(std::make_unique<events::Error>(eptr));
147  };
148 
149  // Reset ######################################################################
150 
151  if constexpr (RTCTK_IS_OPTION(UseStarting, Enabled)) {
152  engine.RegisterAction("ActionStartingEntry", [this](auto c) {
153  m_tmp_request = GetPayloadNothrow<events::Reset>(c);
154  });
155 
156  engine.RegisterAction("ActionStartingDone", [this](auto c) {
157  if (m_tmp_request) {
158  m_tmp_request->SetReplyValue(STD_OK_REPLY);
159  m_tmp_request = nullptr;
160  }
161  });
162  } else {
163  engine.RegisterAction("ActionStartingDone", [this](auto c) {
164  auto req = GetPayloadNothrow<events::Reset>(c);
165  if (req == nullptr) {
166  return;
167  }
168  req->SetReplyValue(STD_OK_REPLY);
169  });
170  }
171 
172  // Init ######################################################################
173 
174  if constexpr (RTCTK_IS_OPTION(UseInitialising, Enabled)) {
175  engine.RegisterAction("ActionInitialisingEntry", [this](auto c) {
176  m_tmp_request = GetPayloadNothrow<events::Init>(c);
177  });
178 
179  engine.RegisterAction("ActionInitialisingDone", [this](auto c) {
180  if (m_tmp_request) {
181  m_tmp_request->SetReplyValue(STD_OK_REPLY);
182  m_tmp_request = nullptr;
183  }
184  });
185 
186  engine.RegisterAction("ActionInitialisingFailed", [this](auto c) {
187  if(auto eptr = GetPayloadNothrow<events::Error>(c); eptr) {
188  if (m_tmp_request) {
189  m_tmp_request->SetException(
191  m_tmp_request = nullptr;
192  }
193  }
194  });
195 
196  engine.RegisterAction("ActionInitialisingStopped", [this](auto c) {
197  auto req = GetPayloadNothrow<events::Stop>(c);
198  if (req == nullptr) {
199  // no event or request
200  return;
201  }
202  if (m_tmp_request) {
203  m_tmp_request->SetException(RequestAborted());
204  m_tmp_request = nullptr;
205  }
206  req->SetReplyValue(STD_OK_REPLY);
207  });
208 
209  engine.RegisterAction("ActionInitialisingRestarted", [this](auto c) {
210  auto req = GetPayloadNothrow<events::Init>(c);
211  if (req == nullptr) {
212  // no event or request
213  return;
214  }
215  if (m_tmp_request) {
216  m_tmp_request->SetException(RequestAborted());
217  m_tmp_request = nullptr;
218  }
219  m_tmp_request = req;
220  });
221  } else {
222  engine.RegisterAction("ActionInitialisingDone", [this](auto c) {
223  auto req = GetPayloadNothrow<events::Init>(c);
224  if (req == nullptr) {
225  return;
226  }
227  req->SetReplyValue(STD_OK_REPLY);
228  });
229  }
230 
231  // Enable ######################################################################
232 
233  if constexpr (RTCTK_IS_OPTION(UseEnabling, Enabled)) {
234  engine.RegisterAction("ActionEnablingEntry", [this](auto c) {
235  m_tmp_request = GetPayloadNothrow<events::Enable>(c);
236  });
237 
238  engine.RegisterAction("ActionEnablingDone", [this](auto c) {
239  if (m_tmp_request) {
240  m_tmp_request->SetReplyValue(STD_OK_REPLY);
241  m_tmp_request = nullptr;
242  }
243  });
244 
245  engine.RegisterAction("ActionEnablingFailed", [this](auto c) {
246  if(auto eptr = GetPayloadNothrow<events::Error>(c); eptr) {
247  if (m_tmp_request) {
248  m_tmp_request->SetException(
250  m_tmp_request = nullptr;
251  }
252  }
253  });
254  } else {
255  engine.RegisterAction("ActionEnablingDone", [this](auto c) {
256  auto req = GetPayloadNothrow<events::Enable>(c);
257  if (req == nullptr) {
258  return;
259  }
260  req->SetReplyValue(STD_OK_REPLY);
261  });
262  }
263 
264  // Disable #####################################################################
265 
266  if constexpr (RTCTK_IS_OPTION(UseDisabling, Enabled)) {
267  engine.RegisterAction("ActionDisablingEntry", [this](auto c) {
268  m_tmp_request = GetPayloadNothrow<events::Disable>(c);
269  });
270 
271  engine.RegisterAction("ActionDisablingDone", [this](auto c) {
272  if (m_tmp_request) {
273  m_tmp_request->SetReplyValue(STD_OK_REPLY);
274  m_tmp_request = nullptr;
275  }
276  });
277 
278  engine.RegisterAction("ActionDisablingFailed", [this](auto c) {
279  if(auto eptr = GetPayloadNothrow<events::Error>(c); eptr) {
280  if (m_tmp_request) {
281  m_tmp_request->SetException(
283  m_tmp_request = nullptr;
284  }
285  }
286  });
287  } else {
288  engine.RegisterAction("ActionDisablingDone", [this](auto c) {
289  auto req = GetPayloadNothrow<events::Disable>(c);
290  if (req == nullptr) {
291  return;
292  }
293  req->SetReplyValue(STD_OK_REPLY);
294  });
295  }
296 
297  // Exit #####################################################################
298 
299  engine.RegisterAction("ActionExit", [this](auto c) {
300  auto req = GetPayloadNothrow<events::Exit>(c);
301  if (req == nullptr) {
302  // no event or request
303  return;
304  }
305  req->SetReplyValue(STD_OK_REPLY);
306  m_engine.Stop();
307  });
308 
309  // GetState #####################################################################
310 
311  engine.RegisterAction("ActionGetState", [this](auto c) {
312  auto req = GetPayloadNothrow<events::GetState>(c);
313  if (req == nullptr) {
314  // no event or request
315  return;
316  }
317  req->SetReplyValue(m_engine.GetState());
318  });
319 
320  // GetVersion #####################################################################
321 
322  engine.RegisterAction("ActionGetVersion", [this](auto c) {
323  auto req = GetPayloadNothrow<events::GetVersion>(c);
324  if (req == nullptr) {
325  // no event or request
326  return;
327  }
328  req->SetReplyValue(VERSION);
329  });
330 
331  // SetLogLevel #####################################################################
332 
333  engine.RegisterAction("ActionSetLogLevel", [this](auto c) {
334  auto req = GetPayloadNothrow<events::SetLogLevel>(c);
335  if (req == nullptr) {
336  // no event or request
337  return;
338  }
339  std::string level = req->GetRequestPayload();
340  auto& logger = GetLogger();
341  log4cplus::LogLevelManager llm;
342  logger.setLogLevel(llm.fromString(level));
343  LOG4CPLUS_INFO(GetLogger(),
344  "Log Level set to " << llm.toString(logger.getLogLevel()));
345  req->SetReplyValue(VERSION);
346  });
347 
348  // Activities #####################################################################
349 
350  if constexpr (RTCTK_IS_OPTION(UseStarting, Enabled)) {
351  m_engine.RegisterActivity("ActivityStarting",
352  [this](StopToken stop_token) {
353  m_logic.ActivityStarting(stop_token);
355  }
356 
357  if constexpr (RTCTK_IS_OPTION(UseInitialising, Enabled)) {
358  m_engine.RegisterActivity("ActivityInitialising",
359  [this](StopToken stop_token) {
360  m_logic.ActivityInitialising(stop_token);
362  }
363 
364  if constexpr (RTCTK_IS_OPTION(UseEnabling, Enabled)) {
365  m_engine.RegisterActivity("ActivityEnabling",
366  [this](StopToken stop_token) {
367  m_logic.ActivityEnabling(stop_token);
369  }
370 
371  if constexpr (RTCTK_IS_OPTION(UseDisabling, Enabled)) {
372  m_engine.RegisterActivity("ActivityDisabling",
373  [this](StopToken stop_token) {
374  m_logic.ActivityDisabling(stop_token);
376  }
377  }
378 
379  virtual ~OutputStage() = default;
380 
381  protected:
384  std::shared_ptr<rad::cii::Request<std::string, void>> m_tmp_request;
385  std::function<void()> m_success_handler;
386  std::function<void(std::exception_ptr)> m_error_handler;
387  };
388 
390  public:
392  RegisterLayer({"StdComponent",
393  {
394  {"use_starting" , RTCTK_IS_OPTION(UseStarting, Enabled)},
395  {"use_initialising" , RTCTK_IS_OPTION(UseInitialising, Enabled)},
396  {"use_enabling" , RTCTK_IS_OPTION(UseEnabling, Enabled)},
397  {"use_disabling" , RTCTK_IS_OPTION(UseDisabling, Enabled)},
398  }});
399 
400  mm.AddState(Initial, "Initial");
401  mm.AddState(Composite, "On");
402  mm.AddState(Final, "Off");
403 
404  mm.AddState(Initial, "On.Initial", "On");
405  mm.AddState(Composite, "On.NotOperational", "On");
406  mm.AddState(Simple, "On.Operational", "On");
407 
408  mm.AddState(Initial, "On.NotOperational.Initial", "On.NotOperational");
409  mm.AddState(Simple, "On.NotOperational.NotReady", "On.NotOperational");
410  mm.AddState(Simple, "On.NotOperational.Ready", "On.NotOperational");
411 
412  mm.AddTrans("Initial" , "On");
413  mm.AddTrans("On" , "Off" , "events.Exit", "" ,"ActionExit");
414  mm.AddTrans("On" , "" , "events.GetState", "" ,"ActionGetState");
415  mm.AddTrans("On" , "" , "events.GetVersion", "" ,"ActionGetVersion");
416  mm.AddTrans("On" , "" , "events.SetLogLevel","" ,"ActionSetLogLevel");
417  mm.AddTrans("On" , "On" , "events.Reset");
418  mm.AddTrans("On.Initial" , "On.NotOperational");
419 
420  if constexpr (RTCTK_IS_OPTION(UseStarting, Enabled)) {
421  mm.AddState(Simple, "On.NotOperational.Starting", "On.NotOperational", "ActivityStarting" ,"ActionStartingEntry");
422 
423  mm.AddTrans("On.NotOperational.Initial" , "On.NotOperational.Starting");
424  mm.AddTrans("On.NotOperational.Starting" , "On.NotOperational.NotReady" , "events.Done", "" ,"ActionStartingDone");
425  } else {
426  mm.AddTrans("On.NotOperational.Initial" , "On.NotOperational.NotReady" , "", "" ,"ActionStartingDone");
427  }
428 
429  if constexpr (RTCTK_IS_OPTION(UseInitialising, Enabled)) {
430  mm.AddState(Simple, "On.NotOperational.Initialising", "On.NotOperational", "ActivityInitialising" ,"ActionInitialisingEntry");
431 
432  mm.AddTrans("On.NotOperational.NotReady" , "On.NotOperational.Initialising" , "events.Init");
433  mm.AddTrans("On.NotOperational.Initialising" , "On.NotOperational.Ready" , "events.Done", "" ,"ActionInitialisingDone");
434  mm.AddTrans("On.NotOperational.Initialising" , "On.NotOperational.NotReady" , "events.Error", "" ,"ActionInitialisingFailed");
435  mm.AddTrans("On.NotOperational.Initialising" , "On.NotOperational.NotReady" , "events.Stop", "" ,"ActionInitialisingStopped");
436  mm.AddTrans("On.NotOperational.Initialising" , "On.NotOperational.Initialising" , "events.Init", "" ,"ActionInitialisingRestarted");
437  mm.AddTrans("On.NotOperational.Ready" , "On.NotOperational.Initialising" , "events.Init");
438  } else {
439  mm.AddTrans("On.NotOperational.NotReady" , "On.NotOperational.Ready" , "events.Init", "" ,"ActionInitialisingDone");
440  }
441 
442  if constexpr (RTCTK_IS_OPTION(UseEnabling, Enabled)) {
443  mm.AddState(Simple, "On.NotOperational.Enabling", "On.NotOperational", "ActivityEnabling" ,"ActionEnablingEntry");
444 
445  mm.AddTrans("On.NotOperational.Ready" , "On.NotOperational.Enabling" , "events.Enable");
446  mm.AddTrans("On.NotOperational.Enabling" , "On.Operational" , "events.Done", "" ,"ActionEnablingDone");
447  mm.AddTrans("On.NotOperational.Enabling" , "On.NotOperational.Ready" , "events.Error", "" ,"ActionEnablingFailed");
448  // TODO, do we want enabling to be stopable?
449  //mm.AddTrans("On.NotOperational.Enabling" , "On.NotOperational.Ready" , "events.Stop" );
450  } else {
451  mm.AddTrans("On.NotOperational.Ready" , "On.Operational" , "events.Enable", "" ,"ActionEnablingDone");
452  }
453 
454  if constexpr (RTCTK_IS_OPTION(UseDisabling, Enabled)) {
455  mm.AddState(Simple, "On.NotOperational.Disabling", "On.NotOperational", "ActivityDisabling" ,"ActionDisablingEntry");
456  mm.AddTrans("On.Operational" , "On.NotOperational.Disabling" , "events.Disable");
457  mm.AddTrans("On.NotOperational.Disabling" , "On.NotOperational.Ready" , "events.Done", "" ,"ActionDisablingDone");
458  mm.AddTrans("On.NotOperational.Disabling" , "On.NotOperational.Ready" , "events.Error", "" ,"ActionDisablingFailed");
459  } else {
460  mm.AddTrans("On.Operational" , "On.NotOperational.Ready" , "events.Disable", "" ,"ActionDisablingDone");
461  }
462  }
463  };
464 };
465 
466 } // namespace rtctk::componentFramework
467 
468 #endif // RTCTK_COMPONENTFRAMEWORK_STDCOMPONENT_HPP
serviceContainer.hpp
A container that can hold any type of service.
rtctk::componentFramework::StdComponent::RTCTK_ASSERT_OPTION_ED
RTCTK_ASSERT_OPTION_ED(UseDisabling)
rtctk::componentFramework::Simple
@ Simple
Definition: model.hpp:23
rtctk::componentFramework::RequestRejected
Definition: stdComponent.hpp:52
commandReplier.hpp
Receive commands via MAL.
rtctk::componentFramework::StdComponent::RTCTK_ASSERT_OPTION_ED
RTCTK_ASSERT_OPTION_ED(UseEnabling)
exceptions.hpp
Provides macros and utilities for exception handling.
stateMachineEngine.hpp
Wrapper around the SCXML State Machine Engine.
rtctk::componentFramework::StdComponent::OutputStage::~OutputStage
virtual ~OutputStage()=default
rtctk::componentFramework::StdComponent::OutputStage::m_tmp_request
std::shared_ptr< rad::cii::Request< std::string, void > > m_tmp_request
Definition: stdComponent.hpp:384
stdCmdsImpl.hpp
Implementation of MAL commands for layer 'StdComponent'.
rtctk::dataTask::detail::Reset
std::error_code Reset(ReaderType &reader)
helper function to reset the ipcq.reader to latest sample
Definition: readerHelpers.hpp:176
rtctk::componentFramework::StdComponent::RTCTK_ASSERT_OPTION_ED
RTCTK_ASSERT_OPTION_ED(UseInitialising)
utils.hpp
Various utilities for Life Cycle Extension.
rtctk::componentFramework::ModelManipulator::AddTrans
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
rtctk::componentFramework::StdComponent::OutputStage::m_error_handler
std::function< void(std::exception_ptr)> m_error_handler
Definition: stdComponent.hpp:386
rtctk::componentFramework::StdComponent::InputStage::m_replier
CommandReplier & m_replier
Definition: stdComponent.hpp:125
rtctk::componentFramework::ModelBuilderBase::mm
ModelManipulator mm
Definition: modelBuilderBase.hpp:86
rtctk::componentFramework::RequestAborted::ERROR_CODE
static constexpr int32_t ERROR_CODE
Definition: stdComponent.hpp:45
rtctk::componentFramework::StdComponent::InputStage::m_engine
StateMachineEngine & m_engine
Definition: stdComponent.hpp:126
rtctk::componentFramework
Definition: commandReplier.cpp:20
rtctk::componentFramework::RTCTK_DEFINE_OPTION
RTCTK_DEFINE_OPTION(UseStarting, Disabled)
rtctk::componentFramework::StdComponent::InputStage
Definition: stdComponent.hpp:111
rtctk::componentFramework::RequestFailed::ERROR_CODE
static constexpr int32_t ERROR_CODE
Definition: stdComponent.hpp:70
rtctk::componentFramework::STD_OK_REPLY
const std::string STD_OK_REPLY
Definition: stdComponent.hpp:36
rtctk::componentFramework::StopToken
rad::StopToken StopToken
Definition: stopToken.hpp:19
rtctk::componentFramework::StateMachineEngine
Definition: stateMachineEngine.hpp:31
rtctk::componentFramework::StdComponent
Basic life cycle for StdComponent.
Definition: stdComponent.hpp:91
rtctk::componentFramework::optional_base
std::conditional_t< Condition, T, empty_base< T > > optional_base
Definition: utils.hpp:90
rtctk::componentFramework::NestedExceptionPrinter
Adapter object intended to be used in contexts without direct access to the output-stream object.
Definition: exceptions.hpp:157
rtctk::componentFramework::StdComponent::OutputStage::m_success_handler
std::function< void()> m_success_handler
Definition: stdComponent.hpp:385
rtctk::componentFramework::RequestRejected::RequestRejected
RequestRejected(std::string const &request_id, std::string const &state_id)
Definition: stdComponent.hpp:58
rtctk::componentFramework::ModelBuilderBase
Base class of the ModelBuilder.
Definition: modelBuilderBase.hpp:32
rtctk::componentFramework::StateMachineEngine::RegisterAction
void RegisterAction(std::string const &id, ActionMethod action)
Register action.
Definition: stateMachineEngine.cpp:62
rtctk::componentFramework::StdComponent::InputStage::~InputStage
virtual ~InputStage()=default
stdBizLogicIf.hpp
Business Logic Interfaces with methods to be implemented in layer 'StdComponent'.
modelBuilderBase.hpp
Base class of the ModelBuilder.
rtctk::componentFramework::GetLogger
log4cplus::Logger & GetLogger(const std::string &name="")
Get handle to a specific logger (used with logging macros)
RTCTK_IS_OPTION
#define RTCTK_IS_OPTION(Name, Value)
Definition: utils.hpp:32
rtctk::componentFramework::StdComponent::InputStage::InputStage
InputStage(CommandReplier &replier, StateMachineEngine &engine)
Definition: stdComponent.hpp:113
rtctk::componentFramework::StdComponent::OutputStage::m_engine
StateMachineEngine & m_engine
Definition: stdComponent.hpp:382
rtctk::componentFramework::NestedExceptionPrinter::Str
std::string Str() const
Convenience function for constructing a std::string from the exception.
Definition: exceptions.hpp:175
rtctk::componentFramework::StdComponent::OutputStage::OutputStage
OutputStage(StateMachineEngine &engine, BizLogicIf &bl)
Definition: stdComponent.hpp:132
rtctk::componentFramework::RequestFailed::RequestFailed
RequestFailed(std::string const &message)
Definition: stdComponent.hpp:71
rtctk::componentFramework::StateMachineEngine::RegisterRejectHandler
void RegisterRejectHandler(std::string const &id, RejectMethod reject)
Register reject handler.
Definition: stateMachineEngine.cpp:95
rtctk::componentFramework::ModelManipulator::AddState
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
rtctk::componentFramework::ModelBuilderBase::RegisterLayer
void RegisterLayer(Layer layer)
Definition: modelBuilderBase.hpp:74
RTCTK_APPLY_OPTION_ED
#define RTCTK_APPLY_OPTION_ED(Options, Name)
Definition: utils.hpp:25
rtctk::componentFramework::CommandReplier
Class that handles reception of commands using MAL.
Definition: commandReplier.hpp:26
rtctk::componentFramework::Initial
@ Initial
Definition: model.hpp:26
rtctk::componentFramework::StdComponent::BizLogicIf
Definition: stdComponent.hpp:108
rtctk::componentFramework::StdComponent::ModelBuilder
Definition: stdComponent.hpp:389
rtctk::componentFramework::StdComponent::RTCTK_ASSERT_OPTION_ED
RTCTK_ASSERT_OPTION_ED(UseStarting)
stdif
Definition: statePublisher.hpp:24
rtctk::componentFramework::Final
@ Final
Definition: model.hpp:27
rtctk::componentFramework::RequestFailed
Definition: stdComponent.hpp:65
logger.hpp
Logging Support Library based on log4cplus.
rtctk::componentFramework::RequestAborted::RequestAborted
RequestAborted()
Definition: stdComponent.hpp:46
mudpi::int32_t
int int32_t
Definition: mudpi.h:17
rtctk::componentFramework::StateMachineEngine::GetState
std::string GetState()
Queries the current state.
Definition: stateMachineEngine.cpp:126
rtctk::componentFramework::RequestAborted
Definition: stdComponent.hpp:43
rtctk::componentFramework::StdComponent::ModelBuilder::ModelBuilder
ModelBuilder(StateMachineEngine &engine)
Definition: stdComponent.hpp:391
rtctk::componentFramework::StdComponent::OutputStage
Definition: stdComponent.hpp:129
rtctk::componentFramework::StdComponent::AppliedOptions
Definition: stdComponent.hpp:96
rtctk::componentFramework::Disabled
std::false_type Disabled
Definition: utils.hpp:47
rtctk::componentFramework::StdComponent::OutputStage::m_logic
BizLogicIf & m_logic
Definition: stdComponent.hpp:383
rtctk::componentFramework::StateMachineEngine::PostEvent
void PostEvent(rad::SharedEvent s)
Injects a new event into the state machine engine.
Definition: stateMachineEngine.cpp:121
rtctk::componentFramework::Composite
@ Composite
Definition: model.hpp:25
rtctk::componentFramework::RequestRejected::ERROR_CODE
static constexpr int32_t ERROR_CODE
Definition: stdComponent.hpp:57
rtctk::componentFramework::StateMachineEngine::Stop
void Stop()
Stops execution of the state machine event loop.
Definition: stateMachineEngine.cpp:152
rtctk::componentFramework::StateMachineEngine::RegisterActivity
void RegisterActivity(std::string const &id, ActivityMethod activity, SuccessMethod on_success, FailureMethod on_failure)
Register activity.
Definition: stateMachineEngine.cpp:87
rtctk::componentFramework::StdComponent::InputStage::Start
virtual void Start()
Definition: stdComponent.hpp:120
rtctk::componentFramework::Enabled
std::true_type Enabled
Definition: utils.hpp:46
rtctk::componentFramework::StdCmdsImpl::Register
static void Register(CommandReplier &replier, StateMachineEngine &engine)
Definition: stdCmdsImpl.hpp:34