Skip to content

call back objects support #31

Open
@Andrei-Pozolotin

Description

@Andrei-Pozolotin
  1. currently, fsm can work only with free call back functions:
struct State {
  State(void (*on_enter)(), void (*on_state)(), void (*on_exit)());
  void (*on_enter)();
  void (*on_state)();
  void (*on_exit)();
};
  1. this makes fsm non-composable with objects, lambdas, etc.

  2. please add support for call back objects instead:

struct State {
  virtual void on_enter() = 0;
  virtual void on_state() = 0;
  virtual void on_exit() = 0;
};
  1. same also applies to transitions
  struct Transition
  {
    State* state_from;
    State* state_to;
    int event;
    void (*on_transition)();

  };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions