18 #ifndef MAUVE_RUNTIME_FINITE_STATE_MACHINE_HPP 19 #define MAUVE_RUNTIME_FINITE_STATE_MACHINE_HPP 22 #include "AbstractFiniteStateMachine.hpp" 23 #include "WithLogger.hpp" 24 #include "WithHook.hpp" 25 #include "FSMContainer.hpp" 43 template <
typename SHELL,
typename CORE>
50 using Guard_t =
typename ExecState<CORE>::Guard_t;
51 using Update_t =
typename ExecState<CORE>::Update_t;
53 template <
typename S,
typename C,
typename F>
64 inline bool is_configured() const override final {
return _configured; }
66 inline bool configure() override final {
return _container->configure_fsm(); }
67 inline void cleanup() override final { _container->cleanup_fsm(); }
74 bool check_reachable()
const;
87 inline SHELL & shell()
const {
return _container->shell(); };
88 inline CORE & core ()
const {
return _container->core(); };
94 std::vector<State<CORE> *> states;
106 virtual const char*
what()
const throw() {
107 std::string message =
"Allready Defined State " + name;
108 return message.c_str();
115 #include "ipp/FiniteStateMachine.ipp" bool is_configured() const overridefinal
Get the configuration status of the configurable object.
Definition: FiniteStateMachine.hpp:64
void cleanup() overridefinal
Cleanup the object.
Definition: FiniteStateMachine.hpp:67
AbstractState * get_state(std::string const &name) const override
Get a state of the FSM by name.
Definition: FiniteStateMachine.ipp:72
Definition: FSMContainer.hpp:30
int get_state_index(const AbstractState *state) const override
Get a index of state in the FSM.
Definition: FiniteStateMachine.ipp:88
AbstractLogger & logger() const override
Get the logger.
Definition: FiniteStateMachine.hpp:62
A Finite State Machine describes the component behavior.
Definition: AbstractFiniteStateMachine.hpp:34
std::string shell_type_name() const override
Get the type of the FSM shell.
Definition: FiniteStateMachine.ipp:58
Objects with hooks.
Definition: WithHook.hpp:27
Object with a Logger.
Definition: WithLogger.hpp:27
std::string core_type_name() const override
Get the type of the FSM core.
Definition: FiniteStateMachine.ipp:65
Component class.
Definition: Architecture.hpp:34
Class of a generic MAUVE logger.
Definition: logger.hpp:39
Definition: Component.hpp:46
The MAUVE namespace.
Definition: tracing.hpp:24
Definition: AbstractCore.hpp:32
const std::string name
Exception name.
Definition: FiniteStateMachine.hpp:104
Abstract State class.
Definition: AbstractState.hpp:34
Definition: AbstractCore.hpp:30
bool configure() overridefinal
Configure the object.
Definition: FiniteStateMachine.hpp:66
Definition: FiniteStateMachine.hpp:44
Exception for Already Defined States.
Definition: FiniteStateMachine.hpp:101
std::size_t get_states_size() const override
Definition: FiniteStateMachine.hpp:69
virtual const char * what() const
Exception explanation.
Definition: FiniteStateMachine.hpp:106