NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
ff_util::FSM Class Reference

#include <ff_fsm.h>

Public Types

typedef int8_t State
 
typedef uint32_t Event
 
typedef std::function< State(Event const &)> TransitionCallback
 
typedef std::function< State(State const &, Event const &)> CatchallCallback
 
typedef std::function< void(State const &, Event const &)> UpdateCallback
 

Public Member Functions

 FSM (State const &initial_state, UpdateCallback callback=nullptr)
 
void Add (State const &s1, Event const &mask, TransitionCallback callback)
 
void Add (State const &s1, State const &s2, Event const &mask, TransitionCallback callback)
 
void Add (State const &s1, State const &s2, State const &s3, Event const &mask, TransitionCallback callback)
 
void Add (Event const &mask, CatchallCallback callback)
 
State GetState ()
 
void SetState (State const &state)
 
void Update (Event const &event)
 

Member Typedef Documentation

◆ CatchallCallback

typedef std::function<State(State const&, Event const&)> ff_util::FSM::CatchallCallback

◆ Event

typedef uint32_t ff_util::FSM::Event

◆ State

typedef int8_t ff_util::FSM::State

◆ TransitionCallback

typedef std::function<State(Event const&)> ff_util::FSM::TransitionCallback

◆ UpdateCallback

typedef std::function<void(State const&, Event const&)> ff_util::FSM::UpdateCallback

Constructor & Destructor Documentation

◆ FSM()

ff_util::FSM::FSM ( State const &  initial_state,
UpdateCallback  callback = nullptr 
)
inline

Member Function Documentation

◆ Add() [1/4]

void ff_util::FSM::Add ( Event const &  mask,
CatchallCallback  callback 
)
inline

◆ Add() [2/4]

void ff_util::FSM::Add ( State const &  s1,
Event const &  mask,
TransitionCallback  callback 
)
inline

◆ Add() [3/4]

void ff_util::FSM::Add ( State const &  s1,
State const &  s2,
Event const &  mask,
TransitionCallback  callback 
)
inline

◆ Add() [4/4]

void ff_util::FSM::Add ( State const &  s1,
State const &  s2,
State const &  s3,
Event const &  mask,
TransitionCallback  callback 
)
inline

◆ GetState()

State ff_util::FSM::GetState ( )
inline

◆ SetState()

void ff_util::FSM::SetState ( State const &  state)
inline

◆ Update()

void ff_util::FSM::Update ( Event const &  event)
inline

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