Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call back objects support #31

Open
Andrei-Pozolotin opened this issue Apr 9, 2019 · 0 comments
Open

call back objects support #31

Andrei-Pozolotin opened this issue Apr 9, 2019 · 0 comments

Comments

@Andrei-Pozolotin
Copy link

  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)();

  };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant