statemachine01.h
#ifndef STATEMACHINE01_H
#define STATEMACHINE01_H
#include "xf/behavior.h"
#include <string>
using namespace std;
class StateMachine01 : public XFBehavior
{
public:
StateMachine01(int repeatInterval, string text);
~StateMachine01() override;
protected:
XFEventStatus processEvent() override;
inline int getRepeatInterval() const { return repeatInterval_; }
inline string getText() const { return text_; }
protected:
typedef enum
{
Timeout_SAY_HELLO_id = 1
} eTimeoutId;
typedef enum
{
STATE_UNKNOWN = 0,
STATE_INITIAL = 1,
STATE_SAY_HELLO = 2
} eMainState;
eMainState currentState_;
int repeatInterval_;
string text_;
};
#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