The MAUVE Toolchain
AbstractFiniteStateMachine.hpp
1 /*
2  * Copyright 2017 ONERA
3  *
4  * This file is part of the MAUVE Runtime project.
5  *
6  * MAUVE Runtime is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License version 3 as
8  * published by the Free Software Foundation.
9  *
10  * MAUVE Runtime is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with MAUVE. If not, see <https://www.gnu.org/licenses/lgpl-3.0>.
17  */
18 #ifndef MAUVE_RUNTIME_ABSTRACT_FINITE_STATE_MACHINE_HPP
19 #define MAUVE_RUNTIME_ABSTRACT_FINITE_STATE_MACHINE_HPP
20 
21 #include "common.hpp"
22 #include "Configurable.hpp"
23 #include "HasProperty.hpp"
24 #include <string>
25 
26 namespace mauve {
27  namespace runtime {
28 
29  class AbstractState;
30 
35  : virtual public Configurable
36  , public HasProperty
37  {
38  public:
39  template <typename S, typename C, typename F>
40  friend class Component;
41 
46 
51  std::string type_name() const;
52 
57  virtual std::string shell_type_name() const = 0;
58 
63  virtual std::string core_type_name () const = 0;
64 
68  virtual std::size_t get_states_size() const = 0;
69 
74  virtual AbstractState* get_state(std::string const & name) const = 0;
75 
80  virtual AbstractState* get_state(int index) const = 0;
81 
86  virtual int get_state_index(const AbstractState* state) const = 0;
87  };
88 
89  }
90 } /* namespace mauve */
91 
92 #endif
virtual std::string core_type_name() const =0
Get the type of the FSM core.
AbstractFiniteStateMachine()
Default constructor.
A Finite State Machine describes the component behavior.
Definition: AbstractFiniteStateMachine.hpp:34
Definition: HasProperty.hpp:53
virtual std::size_t get_states_size() const =0
Component class.
Definition: Architecture.hpp:34
std::string type_name() const
Get the type of this FSM.
The MAUVE namespace.
Definition: tracing.hpp:24
virtual std::string shell_type_name() const =0
Get the type of the FSM shell.
Abstract State class.
Definition: AbstractState.hpp:34
Configurable trait.
Definition: Configurable.hpp:25
virtual AbstractState * get_state(std::string const &name) const =0
Get a state of the FSM by name.
virtual int get_state_index(const AbstractState *state) const =0
Get a index of state in the FSM.
virtual ~AbstractFiniteStateMachine()
Default destructor.