18 #ifndef MAUVE_RUNTIME_COMPONENT_HPP 19 #define MAUVE_RUNTIME_COMPONENT_HPP 22 #include "AbstractComponent.hpp" 23 #include "WithLogger.hpp" 24 #include "WithShell.hpp" 25 #include "WithCore.hpp" 26 #include "WithFSM.hpp" 27 #include "ShellContainer.hpp" 28 #include "CoreContainer.hpp" 29 #include "FSMContainer.hpp" 44 class AbstractFiniteStateMachine;
53 template <
typename SHELL,
typename CORE,
typename FSM>
87 bool clear()
override;
89 template <
typename ...P>
90 bool make(P... parameters);
92 template <
typename S,
typename C,
typename F,
typename ...P>
93 bool make(P... parameters);
104 inline int get_cpu()
const override {
return _cpu; }
105 bool set_cpu(
int cpu)
override;
110 inline SHELL &
shell()
const override {
return *_shell; }
119 template <
typename ...P>
120 bool make_shell(P... parameters);
122 template <
typename S,
typename ...P>
123 bool make_shell(P... parameters);
125 template <
typename S,
typename ...P>
126 bool replace_shell(P... parameters);
131 inline CORE &
core()
const override {
return *_core; }
132 inline CORE *
core_ptr () const override final {
return _core; }
141 template <
typename ...P>
142 bool make_core(P... parameters);
144 template <
typename C,
typename ...P>
145 bool make_core(P... parameters);
147 template <
typename C,
typename ...P>
148 bool replace_core(P... parameters);
153 inline FSM &
fsm()
const override {
return *_fsm; }
162 template <
typename ...P>
163 bool make_fsm(P... parameters);
165 template <
typename F,
typename ...P>
166 bool make_fsm(P... parameters);
168 template <
typename F,
typename ...P>
169 bool replace_fsm(P... parameters);
171 bool step()
override;
193 #include "ipp/Component.ipp" 195 #endif // MAUVE_RUNTIME_COMPONENT_HPP Shell * get_shell() const override
Get a pointer to the shell.
Definition: Component.hpp:109
Class of a MAUVE logger for a component.
Definition: logger.hpp:188
void set_task(Task *task) override
Set the task executing this component.
Definition: Component.ipp:140
void disconnect() override
Disconnect the component.
Definition: Component.ipp:108
int get_priority() const override
Get the priority of the component real-time task.
Definition: Component.hpp:101
bool clear() override
Clear the component.
Definition: Component.ipp:114
void cleanup() override
Cleanup the object.
Definition: Component.ipp:100
Definition: ShellContainer.hpp:28
Task & get_task() const
Get the task executing this component.
Definition: Component.hpp:96
Architecture class.
Definition: Architecture.hpp:41
bool is_empty() const override
Check if the component is empty (i.e.
Definition: Component.ipp:62
Definition: FSMContainer.hpp:30
bool set_priority(int priority) override
Sets the real-time task priority.
Definition: Component.ipp:151
bool is_empty_shell() const override
Check if the shell is empty.
Definition: Component.hpp:112
bool step() override
Make one step on the component FSM.
Definition: Component.ipp:380
A Finite State Machine describes the component behavior.
Definition: AbstractFiniteStateMachine.hpp:34
Object with a Shell.
Definition: WithShell.hpp:28
Component class.
Definition: Architecture.hpp:34
bool clear_fsm() override
Clear the FSM.
Definition: Component.ipp:337
Class of a generic MAUVE logger.
Definition: logger.hpp:39
Definition: Component.hpp:46
bool is_empty_fsm() const override
Check if the FSM is empty.
Definition: Component.hpp:155
The MAUVE namespace.
Definition: tracing.hpp:24
Core container.
Definition: CoreContainer.hpp:33
CORE * core_ptr() const overridefinal
Get a pointer to the Core.
Definition: Component.hpp:132
bool configure_fsm() override
Configure the FSM.
Definition: Component.ipp:312
SHELL & shell() const override
Get the shell.
Definition: Component.hpp:110
Abstract State class.
Definition: AbstractState.hpp:34
Configurable trait.
Definition: Configurable.hpp:25
Object with a Core.
Definition: WithCore.hpp:30
int get_cpu() const override
Get the cpu mapping of the component task.
Definition: Component.hpp:104
bool is_created() const override
Check if the component is created.
Definition: Component.ipp:73
bool is_running() const override
Check if the component is running.
Definition: Component.ipp:85
A Shell is the interface of a component.
Definition: Shell.hpp:48
bool configure_shell() override
Configure th shell.
Definition: Component.ipp:171
bool is_activated() const override
Check if the component is activated.
Definition: Component.ipp:79
AbstractFiniteStateMachine * get_fsm() const override
Get a pointer to the FSM.
Definition: Component.hpp:152
bool clear_shell() override
Clear the shell.
Definition: Component.ipp:194
std::string name() const overridefinal
Get component name.
Definition: AbstractComponent.hpp:62
time_ns_t get_time() const override
Get the component current time.
Definition: Component.ipp:145
bool is_empty_core() const override
Check if the Core is empty.
Definition: Component.hpp:134
AbstractState * current_state() override
Get component current State.
Definition: Component.ipp:398
The Core defines the methods of the component.
Definition: AbstractCore.hpp:37
bool cleanup_core() override
Clean up the Core.
Definition: Component.ipp:251
bool is_configured() const override
Get the configuration status of the configurable object.
Definition: Component.ipp:67
Object with a FiniteStateMachine.
Definition: WithFSM.hpp:28
CORE & core() const override
Get the Core.
Definition: Component.hpp:131
bool configure_core() override
Configure the Core.
Definition: Component.ipp:238
AbstractLogger & logger() const override
Get the logger.
Definition: Component.hpp:72
bool configure() override
Configure the object.
Definition: Component.ipp:91
bool clear_core() override
Clear the Core.
Definition: Component.ipp:264
bool cleanup_fsm() override
Clean up the FSM.
Definition: Component.ipp:325
Abstract Component class.
Definition: AbstractComponent.hpp:43
bool cleanup_shell() override
Clean up the shell.
Definition: Component.ipp:182
AbstractCore * get_core() const override
Get a pointer to the Core.
Definition: Component.hpp:130
A system Task that executes a component.
Definition: Task.hpp:46
bool set_cpu(int cpu) override
Set the affinity of the task of the component to a single processor.
Definition: Component.ipp:160
FSM & fsm() const override
Get the FSM.
Definition: Component.hpp:153