Which State Machine execution frameworks for C++ implement UML semantics?

不羁的心 提交于 2019-12-04 07:21:22

Check out the Quantum Platform.

I've used it on several embedded projects (from very tiny to very large), and it supports all of the bullet items you require, and more.

The web page for the QP does a much better job of explaining itself than I can do here.

Be aware, the QP does not implement 100% of the functionality specified in the UML specification, but the departures are clearly explained, and in all my experience with the QP, none of them have been a problem for the project.

There are also 2 Boost statechart packages, which you seem to know about.

You should go and check out Boost MSM, it's new for Boost 1.44 but seems quite complete. I have not yet tried it out myself but it looks quite promising.

As of today there is a new C++ (supports C++11 and C++03 with Boost) alternative available. It's called yasmine (and I am the architect). It fulfills all the above requirements.

Some pros and cons (cited from the yasmine web page):

Advantages of using yasmine

  • She provides a complete implementation of UML state machine semantics.
  • yasmine is a modern C++ implementation using C++11 (C++03 support is available, too).
  • Because it's C++ (and not C) the code integrates nicely into OO code.
  • She's well documented [...]
  • Because she is open source you can check her implementation out. Also this guarantees long term usability and availability.
  • The library enables you to create state machines at runtime.
  • [...]

What yasmine is not

She's not a minimum foot print library that prioritizes on running on every system no matter how few resources are available. yasmine is not resource hungry, but she cannot (and does not want to) compete with switch-case-based bare-metal no-abstraction libraries.

Note

I know this is an old question, but it's Google's #1 for "c++ uml state machine" which makes it very relevant.

If you are looking for a framework that supports hierarchical and concurrent state machines with UML semantics (entry/exit, transitions, guards, events with parameters, asynchronous/synchronous), have a look at my state machine code and diagram generator.

Instead on implementing the state machine "by hand", describe the state machine in a simple human readable and writable xml description and let the state machine generator write the code source in C++, C# or java.

Actually, for the C++ version, the generated code can be easily cross-compiled for an medium/large size embedded system. It has been done already.

You may have a look at my C++ template class framework STTCL that is purposed to provide mapping of UML 2.2 state diagram notation to implementation classes. The STTCL approach is a refinement of the GoF state pattern and tries to fill the gap(s) to the UML state chart notation.

The framework implementations are configurable regarding OS dependencies as far these are needed (only for asynchronous execution models).

There's a PDF document available explaining the concept in more detail.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!