SMACC
Loading...
Searching...
No Matches
smacc_client_behavior_impl.h
Go to the documentation of this file.
1/*****************************************************************************************************************
2 * ReelRobotix Inc. - Software License Agreement Copyright (c) 2018
3 * Authors: Pablo Inigo Blasco, Brett Aldrich
4 *
5 ******************************************************************************************************************/
6#pragma once
7
10
11namespace smacc
12{
13
14template <typename EventType>
15void ISmaccClientBehavior::postEvent(const EventType &ev)
16{
17 if (stateMachine_ == nullptr)
18 {
19 ROS_ERROR("The client behavior cannot post events before being assigned to an orthogonal. Ignoring post event call.");
20 }
21 else
22 {
24 }
25}
26
27template <typename EventType>
29{
30 if (stateMachine_ == nullptr)
31 {
32 ROS_ERROR("The client behavior cannot post events before being assigned to an orthogonal. Ignoring post event call.");
33 }
34 else
35 {
36
37 stateMachine_->template postEvent<EventType>(EventLifeTime::CURRENT_STATE);
38 }
39}
40
41//inline
43{
44 return this->stateMachine_;
45}
46
47//inline
49{
50 return this->currentState;
51}
52
53template <typename SmaccClientType>
54void ISmaccClientBehavior::requiresClient(SmaccClientType *&storage)
55{
57}
58
59template <typename SmaccComponentType>
60void ISmaccClientBehavior::requiresComponent(SmaccComponentType *&storage)
61{
62 if (stateMachine_ == nullptr)
63 {
64 ROS_ERROR("Cannot use the requiresComponent funcionality before assigning the client behavior to an orthogonal. Try using the OnEntry method to capture required components.");
65 }
66 else
67 {
69 }
70}
71
72template <typename TOrthogonal, typename TSourceObject>
74
75} // namespace smacc
smacc::ISmaccOrthogonal * currentOrthogonal
void requiresComponent(SmaccComponentType *&storage)
void requiresClient(SmaccClientType *&storage)
ISmaccStateMachine * getStateMachine()
bool requiresClient(SmaccClientType *&storage)
void requiresComponent(SmaccComponentType *&storage)
void postEvent(EventType *ev, EventLifeTime evlifetime=EventLifeTime::ABSOLUTE)