Skip to content

Tidy FSM state initialisation #622

Closed Answered by jwellbelove
rblilja asked this question in Q&A
Discussion options

You must be logged in to vote

I've just tried modifying the example and it is entirely possible to have the states as internal classes to the user's FSM.

//*****************************************************************************
// The Finite State Machine.
//*****************************************************************************
class Fsm : public etl::fsm
{
public:

  //***************************************************************************
  // Constructor.
  //***************************************************************************
  Fsm()
    : fsm(1)
  {
    set_states(state_list, 2);
  }

  //***************************************************************************
  // The overridden virtua…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@rblilja
Comment options

Answer selected by rblilja
Comment options

You must be logged in to vote
1 reply
@rblilja
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants