tkem / fsmlite

Lightweight finite state machine framework for C++11
MIT License
161 stars 25 forks source link

Request: Support for multiple guards #34

Open pickledgator opened 3 years ago

pickledgator commented 3 years ago

I have a use case where I often need to validate transitions using multiple guards. For now, this requires an extra member function that wraps other boolean checks such that a single bool output is provided to the fsm API. It would be awesome to reduce some of the boilerplate by supporting the ability to provide a list of guards that need to all be AND'd together to validate the transition. Then on the handle_event, here, you'd just check for each of the provided guards before proceeding. This pattern is similar to the API provided by the python transitions lib.