statemachine04b.h
#ifndef STATEMACHINE04B_H
#define STATEMACHINE04B_H
#include <string>
#include "xf/behavior.h"
class StateMachine04b : public XFBehavior
{
public:
StateMachine04b();
~StateMachine04b() override;
protected:
XFEventStatus processEvent() override;
bool isTimeoutEvent(int timeoutId);
bool isRestartEvent() const;
protected:
typedef enum
{
Timeout_WAIT_id = 1
} eTimeoutId;
typedef enum
{
STATE_UNKOWN = 0,
STATE_INITIAL = 1,
STATE_WAIT = 2
} eMainState;
eMainState currentState_;
int timeout_;
};
#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