digint / digint/tinyfsm

Any chance to pass an Action via an Event

Open
#12 6 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
1.2k
Forks
193
PR merge metrics
No merged PRs in 30d

Description

Probably this is more a general C++ question than it is a tinyfsm one, but maybe somebody did this already.

I have an event called ShouldEstimateAndSend which transits to a new state on a few conditions. I'd like to have it call transit\(ShoudEstimateAndSend::action_function).
Using std::function would work, but this introduces some runtime overhead and pulls in exception handling which is not what I like on my embedded target. Using a template event class 'breaks' inheritance and would need a template react function as far as I can see?!

Can't wiggle my head around this.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.