SMACC2
Loading...
Searching...
No Matches
smacc2
include
smacc2
smacc_types.hpp
Go to the documentation of this file.
1
// Copyright 2025 Robosoft Inc.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
/*****************************************************************************************************************
16
*
17
* Authors: Pablo Inigo Blasco, Brett Aldrich
18
*
19
******************************************************************************************************************/
20
21
#pragma once
22
23
#include <boost/intrusive_ptr.hpp>
24
#include <boost/statechart/transition.hpp>
25
26
#include <utility>
27
28
namespace
smacc2
29
{
30
// Creates an event owned from its first line; pass the result to postEvent().
31
template
<
typename
EventType,
typename
... Args>
32
boost::intrusive_ptr<EventType>
makeEvent
(Args &&... args)
33
{
34
// The one hand-written new for events: they count their own references (MISRA C++:2023 21.6.2 deviation).
35
return
boost::intrusive_ptr<EventType>(
new
EventType(std::forward<Args>(args)...));
36
}
37
38
class
ISmaccState;
39
class
ISmaccStateMachine;
40
class
ISmaccClient;
41
class
ISmaccUpdatable;
42
class
ISmaccComponent;
43
class
ISmaccClientBehavior;
44
class
SmaccClientBehavior;
45
class
SmaccAsyncClientBehavior;
46
class
SignalDetector;
47
48
class
StateReactor;
49
class
SmaccEventGenerator;
50
51
namespace
client_bases
52
{
53
class
ISmaccActionClient;
54
class
ISmaccSubscriber;
55
}
// namespace client_bases
56
57
namespace
introspection
58
{
59
class
SmaccStateMachineInfo;
60
class
SmaccStateInfo;
61
class
StateReactorHandler;
62
struct
SmaccStateReactorInfo;
63
struct
SmaccEventGeneratorInfo;
64
class
TypeInfo;
65
}
// namespace introspection
66
67
// ----TAGS FOR TRANSITIONS -----
68
69
namespace
default_transition_tags
70
{
71
// you can also use these other labels in order to have
72
// a better code readability and also to improve the visual representation
73
// in the viewer
74
struct
DEFAULT
75
{
76
};
77
78
struct
ABORT
79
{
80
};
81
82
struct
SUCCESS
83
{
84
};
85
86
struct
CANCEL
87
{
88
};
89
90
// Kept on purpose: placeholders for the preempted and rejected outcomes (ROS 1 actions had them; ROS 2 result codes do not).
91
/*
92
struct PREEMPT
93
{
94
};
95
96
97
struct REJECT
98
{
99
};*/
100
101
struct
CONTINUELOOP
102
{
103
};
104
struct
ENDLOOP
105
{
106
};
107
108
struct
default_transition_name
:
SUCCESS
109
{
110
};
111
}
// namespace default_transition_tags
112
113
template
<
114
class
Event,
class
Destination,
typename
Tag =
default_transition_tags::default_transition_name
,
115
class
TransitionContext = boost::statechart::detail::no_context<Event>,
116
void (TransitionContext::*pTransitionAction)(
const
Event &) =
117
&boost::statechart::detail::no_context<Event>::no_function>
118
class
Transition
;
119
120
}
// namespace smacc2
smacc2::Transition
Definition
smacc_types.hpp:118
smacc2
Definition
callback_counter_semaphore.hpp:30
smacc2::makeEvent
boost::intrusive_ptr< EventType > makeEvent(Args &&... args)
Definition
smacc_types.hpp:32
smacc2::default_transition_tags::ABORT
Definition
smacc_types.hpp:79
smacc2::default_transition_tags::CANCEL
Definition
smacc_types.hpp:87
smacc2::default_transition_tags::CONTINUELOOP
Definition
smacc_types.hpp:102
smacc2::default_transition_tags::DEFAULT
Definition
smacc_types.hpp:75
smacc2::default_transition_tags::ENDLOOP
Definition
smacc_types.hpp:105
smacc2::default_transition_tags::SUCCESS
Definition
smacc_types.hpp:83
smacc2::default_transition_tags::default_transition_name
Definition
smacc_types.hpp:109
Generated by
1.12.0