StateParameterExample.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5*
6* ArmarX is free software; you can redistribute it and/or modify
7* it under the terms of the GNU General Public License version 2 as
8* published by the Free Software Foundation.
9*
10* ArmarX is distributed in the hope that it will be useful, but
11* WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17*
18* @package ArmarXCore::StatechartExamples::StateParameterExample
19* @author Mirko Waechter (mirko.waechter at kit dot edu)
20* @date 2012
21* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22* GNU General Public License
23*/
24
25#pragma once
26
30
31namespace armarx
32{
34 {
35 public:
36 // inherited from Component
37 std::string
38 getDefaultName() const override
39 {
40 return "StateParameterExample";
41 };
42
43 void onInitStatechart() override;
44 void onConnectStatechart() override;
45 void run();
46 };
47
48 // Define Events before the first state they are used in
50 EvInit) // this macro declares a new event-class derived vom Event, to have a compiletime check for typos in events
51 DEFINEEVENT(EvNext)
52
53 struct StateResult;
54
55 struct Statechart_StateParameterExample : StateTemplate<Statechart_StateParameterExample>
56 {
57
58 void defineState() override;
59
60 void defineSubstates() override;
61 void defineParameters() override;
62
63 void onEnter() override;
64 };
65
66 struct StateRun : StateTemplate<StateRun>
67 {
68 ConditionIdentifier condId;
69 void defineParameters() override;
70 void onEnter() override;
71 void onBreak() override;
72
73 void onExit() override;
74 };
75
76 struct StateResult : StateTemplate<StateResult>
77 {
78 void defineParameters() override;
79 void onEnter() override;
80 };
81
82} // namespace armarx
#define ARMARXCOMPONENT_IMPORT_EXPORT
#define DEFINEEVENT(NEWEVENT)
this macro declares a new event-class derived vom Event, to have a compiletime check for typos in eve...
std::string getDefaultName() const override
Retrieve default name of component.
Template class from which all states with additional functionality like an overriden onEnter() functi...
This file offers overloads of toIce() and fromIce() functions for STL container types.
void defineParameters() override
Virtual function, in which input/local/output parameters can be specified.
void onEnter() override
Virtual function, in which the behaviour of state is defined, when it is entered. Can be overridden,...
void defineParameters() override
Virtual function, in which input/local/output parameters can be specified.
void onBreak() override
Virtual function, in which the behaviour of state is defined, when it is abnormally exited....
ConditionIdentifier condId
void onEnter() override
Virtual function, in which the behaviour of state is defined, when it is entered. Can be overridden,...
void onExit() override
Virtual function, in which the behaviour of state is defined, when it is exited. Can be overridden,...
void defineParameters() override
Virtual function, in which input/local/output parameters can be specified.
void onEnter() override
Virtual function, in which the behaviour of state is defined, when it is entered. Can be overridden,...
void defineState() override
Virtual function, in which this state can be configured.
void defineSubstates() override
Virtual function, in which substates, transition and mappings can be added.