StatechartPerformanceTest.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 ArmarX::StatechartPerfomanceTest
19* @author ( at kit dot edu)
20* @date
21* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22* GNU General Public License
23*/
24
25#pragma once
26
27#include <IceUtil/Time.h>
28
32
33//#define REMOTE
34
35namespace armarx
36{
38#ifdef REMOTE
39 virtual public RemoteStateOfferer
40#else
41 virtual public StatechartContext
42#endif
43
44 {
45 public:
46 // inherited from Component
47 std::string
48 getDefaultName() const override
49 {
50 return "PerfTest";
51 }
52#ifdef REMOTE
53 virtual void onInitRemoteStateOfferer();
54#else
55 void onInitStatechart() override;
56 void onConnectStatechart() override;
57 void onExitStatechart() override;
58
59#endif
60 };
61
62 // Define Events before the first state they are used in
64 EvInit) // this macro declares a new event-class derived vom Event, to have a compiletime check for typos in events
65 DEFINEEVENT(EvNext)
66 DEFINEEVENT(EvTimeout)
67
68 // forward declare all substates
69 struct StateRun;
70
71 struct Statechart_StatechartPerfomanceTest : StateTemplate<Statechart_StatechartPerfomanceTest>
72 {
73
74 void
75 defineState() override
76 {
77 setUseRunFunction(false);
78 }
79
80 void defineParameters() override;
81 void defineSubstates() override;
82 };
83
84 struct StateRun : public StateTemplate<StateRun>
85 {
86 public:
87 IceUtil::Time lastCall;
89
90 ConditionIdentifier condId;
91
92 void
98
99 void defineParameters() override;
100 void onEnter() override;
101 void onExit() override;
102 };
103
104
105} // 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...
void setLocalMinimumLoggingLevel(MessageTypeT level)
With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set.
Definition Logging.cpp:66
void setUseRunFunction(bool useRunFuntion)
setUseRunFunction can be used to configurate whether the thread with the async.
Definition State.cpp:381
std::string getDefaultName() const override
Retrieve default name of component.
This file offers overloads of toIce() and fromIce() functions for STL container types.
Class that holds states, which offer functionality for other states over Ice.
void defineParameters() override
Virtual function, in which input/local/output parameters can be specified.
ConditionIdentifier condId
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 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 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.