https://github.com/k1ngmar/msm
☊ A high performance compile time evaluated state machine
https://github.com/k1ngmar/msm
cpp header-only state-machine template-metaprogramming
Last synced: about 2 months ago
JSON representation
☊ A high performance compile time evaluated state machine
- Host: GitHub
- URL: https://github.com/k1ngmar/msm
- Owner: K1ngmar
- License: mit
- Created: 2024-09-27T08:52:00.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-12-01T15:45:36.000Z (6 months ago)
- Last Synced: 2025-04-13T07:58:51.776Z (about 2 months ago)
- Topics: cpp, header-only, state-machine, template-metaprogramming
- Language: C++
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ✔️ Meta State Machine
A high performance headeronly compile time evaluated statemachine.
Big shoutout to [boost::msm](https://www.boost.org/doc/libs/1_86_0/libs/msm/doc/HTML/index.html) for inspiring me to create this project.
I started this project to learn more about template metaprogramming while also making something very usefull for some of my other projects.
It is probably (definitely :sweat_smile:) not as complete and performant as boost::msm since they have put years of reasearch into it and use even less runtime stuff than I do here :)# ⚙️ Requirements
A C++ compiler that has c++20 support.# 🎓 Learn more about MSM
Check out the [wiki](https://github.com/K1ngmar/MSM/wiki) to learn more about the msms and its implementation!# 🤯 Important to know
### Thread safety
By itself the statemachine is not thread safe, if you want to dispatch events from multiple events you would need to handle this yourself in the calls to `ProcessEvent();`.### Event processing
If an event is dispatched whilst it is performing a transition the event will be stored in a queue and will be executed as soon as the current transition is finished. This means that if you decide to do a lot of computation in an `OnEntry()`, `OnExit()` etc. it will block the statemachine from perfoming transitions. Think carefull about how you implement these functions :)