16#ifndef YASMIN__TYPES_HPP_
17#define YASMIN__TYPES_HPP_
23#include <unordered_map>
29#define YASMIN_SHARED_PTR_ALIAS(...) \
30 using SharedPtr = std::shared_ptr<__VA_ARGS__>; \
31 using ConstSharedPtr = std::shared_ptr<const __VA_ARGS__>; \
32 template <typename... Args> \
33 static std::shared_ptr<__VA_ARGS__> make_shared(Args &&...args) { \
34 return std::make_shared<__VA_ARGS__>(std::forward<Args>(args)...); \
38#define YASMIN_UNIQUE_PTR_ALIAS(...) \
39 using UniquePtr = std::unique_ptr<__VA_ARGS__>; \
40 template <typename... Args> \
41 static std::unique_ptr<__VA_ARGS__> make_unique(Args &&...args) { \
42 return std::unique_ptr<__VA_ARGS__>( \
43 new __VA_ARGS__(std::forward<Args>(args)...)); \
47#define YASMIN_WEAK_PTR_ALIAS(...) \
48 using WeakPtr = std::weak_ptr<__VA_ARGS__>; \
49 using ConstWeakPtr = std::weak_ptr<const __VA_ARGS__>;
52#define YASMIN_PTR_ALIASES(ClassName) \
56 YASMIN_SHARED_PTR_ALIAS(ClassName) \
61 YASMIN_UNIQUE_PTR_ALIAS(ClassName) \
66 YASMIN_WEAK_PTR_ALIAS(ClassName)
80using StringMap = std::unordered_map<std::string, std::string>;
87using OutcomeMap = std::unordered_map<std::string, StateOutcomeMap>;
96using RemappingsMap = std::unordered_map<std::string, Remappings>;
103using StatePtr = std::shared_ptr<State>;
110using StateMap = std::unordered_map<std::string, std::shared_ptr<State>>;
113using CbStateCallback = std::function<std::string(std::shared_ptr<Blackboard>)>;
Runs a series of states in parallel.
Definition concurrence.hpp:45
A class that implements a state machine with a set of states, transitions, and callback mechanisms fo...
Definition state_machine.hpp:40
Definition blackboard.hpp:31
std::unordered_map< std::string, StateOutcomeMap > OutcomeMap
Map of outcomes to state outcome maps.
Definition types.hpp:81
std::unordered_map< std::string, std::shared_ptr< State > > StateMap
Map of state names to state pointers.
Definition types.hpp:104
StringMap Transitions
Map of transitions (string to string)
Definition types.hpp:84
StringSet Outcomes
Set of possible outcomes for states.
Definition types.hpp:77
std::unordered_map< std::string, Remappings > RemappingsMap
Map of keys to remappings.
Definition types.hpp:90
std::shared_ptr< Concurrence > ConcurrencePtr
Shared pointer to Concurrence.
Definition types.hpp:101
StringMap StateOutcomeMap
Map of state names to their outcomes.
Definition types.hpp:79
std::shared_ptr< StateMachine > StateMachinePtr
Shared pointer to StateMachine.
Definition types.hpp:99
std::unordered_map< std::string, std::string > StringMap
Map from string to string.
Definition types.hpp:74
std::set< std::string > StringSet
Set of strings.
Definition types.hpp:72
std::unordered_map< std::string, Transitions > TransitionsMap
Map of state names to transitions.
Definition types.hpp:86
std::shared_ptr< State > StatePtr
Shared pointer to State.
Definition types.hpp:97
std::shared_ptr< Blackboard > BlackboardPtr
Shared pointer to Blackboard.
Definition types.hpp:95
StringMap Remappings
Map of remappings (string to string)
Definition types.hpp:88
std::function< std::string(std::shared_ptr< Blackboard >)> CbStateCallback
Callback function type for CbState.
Definition types.hpp:107
StringMap TypeRegistry
Registry for type information.
Definition types.hpp:92