SMACC2
Loading...
Searching...
No Matches
common.hpp
Go to the documentation of this file.
1// Copyright 2021 RobosoftAI 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#pragma once
21
22// boost statechart
23#define BOOST_BIND_NO_PLACEHOLDERS
24#include <boost/statechart/asynchronous_state_machine.hpp>
25#include <boost/statechart/custom_reaction.hpp>
26#include <boost/statechart/deep_history.hpp>
27#include <boost/statechart/event.hpp>
28#include <boost/statechart/simple_state.hpp>
29#include <boost/statechart/state.hpp>
30
31// other boost includes
32#include <boost/algorithm/string.hpp>
33#include <boost/any.hpp>
34#include <boost/config.hpp>
35#include <boost/function.hpp>
36#include <boost/intrusive_ptr.hpp>
37#include <boost/mpl/list.hpp>
38#include <boost/signals2.hpp>
39
40#include <mutex>
41#include <rclcpp/rclcpp.hpp>
42
46
47typedef boost::statechart::processor_container<
48 boost::statechart::fifo_scheduler<>, boost::function0<void>,
49 std::allocator<boost::statechart::none>>::processor_context my_context;
50
51namespace smacc2
52{
53template <class T>
54using deep_history = sc::deep_history<T>;
55
56namespace utils
57{
58// demangles the type name to be used as a ros node name
59std::string cleanShortTypeName(const std::type_info & tinfo);
60
61template <typename T>
62std::string cleanShortTypeName()
63{
64 return cleanShortTypeName(typeid(T));
65}
66} // namespace utils
67
68enum class SMRunMode
69{
70 DEBUG,
72};
73
74} // namespace smacc2
75
boost::statechart::processor_container< boost::statechart::fifo_scheduler<>, boost::function0< void >, std::allocator< boost::statechart::none > >::processor_context my_context
Definition common.hpp:49
std::string cleanShortTypeName()
Definition common.hpp:62
SMRunMode
Definition common.hpp:69
sc::deep_history< T > deep_history
Definition common.hpp:54