XF Test Bench 3.3

statemachine01.h
1#ifndef STATEMACHINE01_H
2#define STATEMACHINE01_H
3
4#include "xf/behavior.h"
5#include <string>
6
7 using namespace std;
8
18 class StateMachine01 : public XFBehavior
19{
20 public:
21 StateMachine01(int repeatInterval, string text);
22 ~StateMachine01() override;
23
24 protected:
25 XFEventStatus processEvent() override;
26
27 inline int getRepeatInterval() const { return repeatInterval_; }
28 inline string getText() const { return text_; }
29
30 protected:
34 typedef enum
35 {
36 Timeout_SAY_HELLO_id = 1
37 } eTimeoutId;
38
43 typedef enum
44 {
45 STATE_UNKNOWN = 0,
46 STATE_INITIAL = 1,
47 STATE_SAY_HELLO = 2
48 } eMainState;
49
50 eMainState currentState_;
51
52 int repeatInterval_;
53 string text_;
54};
55
56#endif // STATEMACHINE01_H
StateMachine01
Definition: statemachine01.h:19
StateMachine01::repeatInterval_
int repeatInterval_
Interval in milliseconds to repeat text in state machine.
Definition: statemachine01.h:52
StateMachine01::eTimeoutId
eTimeoutId
Definition: statemachine01.h:35
StateMachine01::Timeout_SAY_HELLO_id
@ Timeout_SAY_HELLO_id
Timeout id for WAIT.
Definition: statemachine01.h:36
StateMachine01::StateMachine01
StateMachine01(int repeatInterval, string text)
Definition: statemachine01.cpp:11
StateMachine01::text_
string text_
Text to display in state machine state.
Definition: statemachine01.h:53
StateMachine01::getRepeatInterval
int getRepeatInterval() const
Returns repeat interval. Accessor for #_repeatInterval.
Definition: statemachine01.h:27
StateMachine01::eMainState
eMainState
Definition: statemachine01.h:44
StateMachine01::STATE_UNKNOWN
@ STATE_UNKNOWN
Unknown state.
Definition: statemachine01.h:45
StateMachine01::STATE_SAY_HELLO
@ STATE_SAY_HELLO
Say hello state.
Definition: statemachine01.h:47
StateMachine01::STATE_INITIAL
@ STATE_INITIAL
Initial state.
Definition: statemachine01.h:46
StateMachine01::getText
string getText() const
Returns text. Accessor for #_text.
Definition: statemachine01.h:28
StateMachine01::currentState_
eMainState currentState_
Attribute indicating currently active state.
Definition: statemachine01.h:50
StateMachine01::processEvent
XFEventStatus processEvent() override
Remplementation from XFBehavior.
Definition: statemachine01.cpp:23