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 
31 namespace armarx
32 {
34  virtual public StatechartContext
35  {
36  public:
37  // inherited from Component
38  std::string getDefaultName() const override
39  {
40  return "StateParameterExample";
41  };
42  void onInitStatechart() override;
43  void onConnectStatechart() override;
44  void run();
45  };
46 
47  // Define Events before the first state they are used in
48  DEFINEEVENT(EvInit) // this macro declares a new event-class derived vom Event, to have a compiletime check for typos in events
49  DEFINEEVENT(EvNext)
50 
51  struct StateResult;
52  struct Statechart_StateParameterExample : StateTemplate<Statechart_StateParameterExample>
53  {
54 
55  void defineState() override;
56 
57  void defineSubstates() override;
58  void defineParameters() override;
59 
60  void onEnter() override;
61  };
62 
63  struct StateRun : StateTemplate<StateRun>
64  {
65  ConditionIdentifier condId;
66  void defineParameters() override;
67  void onEnter() override;
68  void onBreak() override;
69 
70  void onExit() override;
71  };
72 
73  struct StateResult : StateTemplate<StateResult>
74  {
75  void defineParameters() override;
76  void onEnter() override;
77 
78  };
79 
80 }
81 
armarx::Statechart_StateParameterExample
Definition: StateParameterExample.h:52
armarx::StateRun
Definition: StatechartPerformanceTest.h:80
armarx::StateRun::onEnter
void onEnter() override
Definition: StatechartPerformanceTest.cpp:122
armarx::Statechart_StateParameterExample::onEnter
void onEnter() override
Definition: StateParameterExample.cpp:110
armarx::StateTemplate
Definition: State.h:39
armarx::StateRun::defineParameters
void defineParameters() override
Definition: StatechartPerformanceTest.cpp:113
armarx::StateParameterExample::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: StateParameterExample.h:38
armarx::StateResult::defineParameters
void defineParameters() override
Definition: StateParameterExample.cpp:148
armarx::Statechart_StateParameterExample::defineSubstates
void defineSubstates() override
Definition: StateParameterExample.cpp:66
Statechart.h
armarx::StateResult::onEnter
void onEnter() override
Definition: StateParameterExample.cpp:157
armarx::Statechart_StateParameterExample::defineState
void defineState() override
Definition: StateParameterExample.cpp:62
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::StateRun::condId
ConditionIdentifier condId
Definition: StatechartPerformanceTest.h:86
armarx::StateRun::onBreak
void onBreak() override
Definition: StateParameterExample.cpp:137
armarx::StatechartContext
This class contains a statechart and provides the interfaces to distributed components.
Definition: StatechartContext.h:89
armarx::Statechart_StateParameterExample::defineParameters
void defineParameters() override
Definition: StateParameterExample.cpp:93
Component.h
armarx::StateParameterExample
Definition: StateParameterExample.h:33
armarx::StateResult
Definition: StateParameterExample.h:73
armarx::StateRun::onExit
void onExit() override
Definition: StatechartPerformanceTest.cpp:160
armarx::DEFINEEVENT
DEFINEEVENT(EvInit) struct StateRun
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
ImportExportComponent.h