SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
sm::StateAction< SM, Data, Func > Class Template Reference

#include <StateMachine.h>

Inheritance diagram for sm::StateAction< SM, Data, Func >:
[legend]

Public Member Functions

virtual void invokeStateAction (StateMachine *sm, const EventData *data, const bool stateEntry, const bool stateExit) const
 
- Public Member Functions inherited from sm::StateBase
virtual ~StateBase ()
 

Detailed Description

template<class SM, class Data, void(SM::*)(const Data *, const bool, const bool) Func>
class sm::StateAction< SM, Data, Func >

StateAction takes three template arguments: A state machine class, a state function event data type (derived from EventData) and a state machine member function pointer.

Template Parameters
SM
Data
Func

Definition at line 55 of file StateMachine.h.

Member Function Documentation

◆ invokeStateAction()

template<class SM , class Data , void(SM::*)(const Data *, const bool, const bool) Func>
virtual void sm::StateAction< SM, Data, Func >::invokeStateAction ( StateMachine sm,
const EventData data,
const bool  stateEntry,
const bool  stateExit 
) const
inlinevirtual

Called by the state machine to execute a state action.

Parameters
smA state machine instance
dataThe event data
stateEntry
stateExit

Reimplemented from sm::StateBase.

Definition at line 58 of file StateMachine.h.

62  {
63  // Downcast the state machine and event data to the correct derived type
64  SM* derivedSM = static_cast<SM*>(sm);
65 
66  const Data* derivedData = dynamic_cast<const Data*>(data);
67 
68  // Call the state function
69  (derivedSM->*Func)(derivedData, stateEntry, stateExit);
70  }
Collection of classes for a state machine implementation used in the Erleb-AR app.
Definition: Event.h:25

The documentation for this class was generated from the following file: