Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6fsm.h
Go to the documentation of this file.
1 
7 #ifndef P6FSM_H__
8 #define P6FSM_H__ 1
9 
10 #include "p6fsmtable.h"
11 
12 namespace P6R {
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
22  static const P6FSMFLAGS P6FSM_NOFLAGS = 0x00000000;
23  static const P6FSMFLAGS P6FSM_LOGTRANSITIONS = 0x00000001;
34  interface p6IFsm : public P6R::p6ICom
35  {
52  P6COMMETHOD initialize(P6R::p6IFsmTable *pStateTable,P6R::P6FSMFLAGS fFlags) = 0;
53 
59  P6COMMETHOD reset() = 0;
60 
70 
85 
95  P6COMMETHOD getLastState(P6R::P6FSMSTATE *pnLastState) = 0;
96 
106 
116  P6COMMETHOD getLastEvent(P6R::P6FSMEVENT *pnLastEvent) = 0;
117 
132  P6COMMETHOD stateToStrW(P6R::P6FSMSTATE nState,P6R::P6WCHAR *pBuffer,P6R::P6SIZE *pcBuffer) = 0;
133 
148  P6COMMETHOD eventToStrW(P6R::P6FSMEVENT nEvent,P6R::P6WCHAR *pBuffer,P6R::P6SIZE *pcBuffer) = 0;
149 
164  P6COMMETHOD actionToStrW(P6R::P6FSMACTION nAction,P6R::P6WCHAR *pBuffer,P6R::P6SIZE *pcBuffer) = 0;
165  };
166 
167  // {3ABD7B8D-8EB7-499F-96B9-07B432CAFF88}
168  #define IF_p6IFsm {0x3ABD7B8D,0x8EB7,0x499F,{0x96,0xB9,0x07,0xB4,0x32,0xCA,0xFF,0x88}}
169 
170  // {65FB2BB9-61EA-461E-B264-9990CC47611B}
171  #define COMP_p6Fsm {0x65FB2BB9,0x61EA,0x461E,{0xB2,0x64,0x99,0x90,0xCC,0x47,0x61,0x1B}}
172 
173 #ifdef __cplusplus
174 }
175 #endif
176 
177 } // namespace
178 
179 #endif
180 
181 
virtual P6R::P6ERR actionToStrW(P6R::P6FSMACTION nAction, P6R::P6WCHAR *pBuffer, P6R::P6SIZE *pcBuffer)=0
Converts a action value into a P6WCHAR string.
size_t P6SIZE
Definition: p6types.h:62
P6R::P6UINT16 P6FSMSTATE
type used to represent state values in the state machine
Definition: p6fsm.h:18
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR stateToStrW(P6R::P6FSMSTATE nState, P6R::P6WCHAR *pBuffer, P6R::P6SIZE *pcBuffer)=0
Converts a state value into a P6WCHAR string.
virtual P6R::P6ERR enableLogging(P6R::P6BOOL bEnable)=0
Enable/disables state transition logging.
P6R::P6UINT16 P6FSMEVENT
type used to represent event values in the state machine
Definition: p6fsm.h:19
bool P6BOOL
Boolean type.
Definition: p6types.h:101
virtual P6R::P6ERR reset()=0
Used to reset the state machine back to the initial state.
This component provides a general purpose finite state machine engine that can be used with anything...
Definition: p6fsm.h:34
virtual P6R::P6ERR getLastState(P6R::P6FSMSTATE *pnLastState)=0
Retrieves the previous state.
unsigned short int P6UINT16
Definition: p6types.h:34
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:76
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
virtual P6R::P6ERR getCurrentState(P6R::P6FSMSTATE *pnCurState)=0
Retieves the current state of the state machine.
P6R::P6UINT32 P6FSMFLAGS
type for controls flags passed into p6IFsm
Definition: p6fsm.h:21
#define P6COMMETHOD
Definition: p6types.h:872
virtual P6R::P6ERR eventToStrW(P6R::P6FSMEVENT nEvent, P6R::P6WCHAR *pBuffer, P6R::P6SIZE *pcBuffer)=0
Converts a event value into a P6WCHAR string.
virtual P6R::P6ERR getLastEvent(P6R::P6FSMEVENT *pnLastEvent)=0
Retrieves the previous event processed.
P6R::P6UINT16 P6FSMACTION
type used to represent action values in the state machine
Definition: p6fsm.h:20
virtual P6R::P6ERR processEvent(P6R::P6FSMEVENT nEvent, P6R::P6FSMACTION *pnAction)=0
Given an event, this methof runs the state machine to the next state and returns the associated actio...
virtual P6R::P6ERR initialize(P6R::p6IFsmTable *pStateTable, P6R::P6FSMFLAGS fFlags)=0
Initializes the finite state machine interface for use.