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  {
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
armarx::Statechart_StateParameterExample
Definition: StateParameterExample.h:55
armarx::StateRun
Definition: StatechartPerformanceTest.h:84
armarx::StateRun::onEnter
void onEnter() override
Definition: StatechartPerformanceTest.cpp:129
armarx::Statechart_StateParameterExample::onEnter
void onEnter() override
Definition: StateParameterExample.cpp:114
armarx::StateTemplate
Definition: State.h:38
armarx::StateRun::defineParameters
void defineParameters() override
Definition: StatechartPerformanceTest.cpp:119
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:152
armarx::Statechart_StateParameterExample::defineSubstates
void defineSubstates() override
Definition: StateParameterExample.cpp:69
Statechart.h
armarx::StateResult::onEnter
void onEnter() override
Definition: StateParameterExample.cpp:161
armarx::Statechart_StateParameterExample::defineState
void defineState() override
Definition: StateParameterExample.cpp:64
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::StateRun::condId
ConditionIdentifier condId
Definition: StatechartPerformanceTest.h:90
armarx::StateRun::onBreak
void onBreak() override
Definition: StateParameterExample.cpp:141
armarx::StatechartContext
This class contains a statechart and provides the interfaces to distributed components.
Definition: StatechartContext.h:85
armarx::Statechart_StateParameterExample::defineParameters
void defineParameters() override
Definition: StateParameterExample.cpp:98
Component.h
armarx::StateParameterExample
Definition: StateParameterExample.h:33
armarx::StateResult
Definition: StateParameterExample.h:76
armarx::StateRun::onExit
void onExit() override
Definition: StatechartPerformanceTest.cpp:172
armarx::DEFINEEVENT
DEFINEEVENT(EvInit) struct StateRun
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
ImportExportComponent.h