Components/Libraries/XF/FreeRTOS/StateMachine

(Difference between revisions)
Jump to: navigation, search
(eEventStatus processEvent(Event *opEv) [pure virtual])
(eEventStatus process(Event *opEv))
Line 36: Line 36:
 
== eEventStatus process(Event *opEv) ==
 
== eEventStatus process(Event *opEv) ==
 
=== Description ===
 
=== Description ===
Cancel an event that has been sent
+
Process the event. Just call the protected method processEvent()
 
=== Parameters ===
 
=== Parameters ===
Event* '''opEv''' : a pointer to the event to cancel
+
Event* '''opEv''' : a pointer to the event to process
 +
=== Return ===
 +
returns the status of the event
  
 
== void cancelEvent(Event* opEv) [virtual] ==
 
== void cancelEvent(Event* opEv) [virtual] ==

Revision as of 13:53, 21 August 2017

Contents

StateMachine

This class is a basic state machine whose users state machine must inherits if they would work with XFOS

Member Attributes

Member Functions Documentation

StateMachine(string oName, Thread* opThread)

Description

The constructor of the StateMachine. It automatically set the actual state to Initial.

If useStateMachineDirectory is define, it add the state machine to the directory

Parameters

string oName : the name of the state machine

Thread* opThread : a pointer to the thread where the state machine will live

~StateMachine() [virtual]

Description

The destructor of the StateMachine

Thread* getThread()

Description

Returns the thread where the state machine is living

void startProcessing() [virtual]

Description

Starts the state machine. Send an Initial event that will start the state machine. This function is normally used only one time at the beginning of the state machine

void pushEvent(Event* opEv)

Description

Send an event to the thread to switch to another state

Parameters

Event* opEv : a pointer to the event to push

eEventStatus process(Event *opEv)

Description

Process the event. Just call the protected method processEvent()

Parameters

Event* opEv : a pointer to the event to process

Return

returns the status of the event

void cancelEvent(Event* opEv) [virtual]

Description

Parameters

eEventStatus processEvent(Event *opEv) [pure virtual]

Description

The state machine will execute the code of the new state and send an other event to switch to the next state. This method must be reimplemeted by a subclass

Parameters

Event* opEv : a pointer to the event to process

Personal tools
Namespaces
Variants
Actions
Navigation
Browse
Toolbox