XF Test Bench 3.3

statemachine04b.h
1#ifndef STATEMACHINE04B_H
2#define STATEMACHINE04B_H
3
4#include <string>
5#include "xf/behavior.h"
6
17 class StateMachine04b : public XFBehavior
18{
19 public:
20 StateMachine04b();
21 ~StateMachine04b() override;
22
23 protected:
24 XFEventStatus processEvent() override;
25
26 bool isTimeoutEvent(int timeoutId);
27 bool isRestartEvent() const;
28
29 protected:
33 typedef enum
34 {
35 Timeout_WAIT_id = 1
36 } eTimeoutId;
37
42 typedef enum
43 {
44 STATE_UNKOWN = 0,
45 STATE_INITIAL = 1,
46 STATE_WAIT = 2
47 } eMainState;
48
49 eMainState currentState_;
50 int timeout_;
51};
52
53#endif // STATEMACHINE04B_H
StateMachine04b
Definition: statemachine04b.h:18
StateMachine04b::isRestartEvent
bool isRestartEvent() const
Returns true in case state machine is currently processing an evRestart event.
Definition: statemachine04b.cpp:81
StateMachine04b::processEvent
XFEventStatus processEvent() override
Definition: statemachine04b.cpp:20
StateMachine04b::eMainState
eMainState
Definition: statemachine04b.h:43
StateMachine04b::STATE_UNKOWN
@ STATE_UNKOWN
Unkown state.
Definition: statemachine04b.h:44
StateMachine04b::STATE_INITIAL
@ STATE_INITIAL
Initial state.
Definition: statemachine04b.h:45
StateMachine04b::STATE_WAIT
@ STATE_WAIT
Wait for timeout state.
Definition: statemachine04b.h:46
StateMachine04b::eTimeoutId
eTimeoutId
Definition: statemachine04b.h:34
StateMachine04b::Timeout_WAIT_id
@ Timeout_WAIT_id
Timeout id for WAIT.
Definition: statemachine04b.h:35
StateMachine04b::currentState_
eMainState currentState_
Attribute indicating currently active state.
Definition: statemachine04b.h:49
StateMachine04b::isTimeoutEvent
bool isTimeoutEvent(int timeoutId)
Returns true in case state machine is currently processing a timeout.
Definition: statemachine04b.cpp:75
StateMachine04b::timeout_
int timeout_
Timeout attribute counting rised timeouts in state machine.
Definition: statemachine04b.h:50