You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ A compact C finite state machine (FSM) implementation that's easy to use on embe
13
13
-[Table of Contents](#table-of-contents)
14
14
-[Preface](#preface)
15
15
-[Related repositories](#related-repositories)
16
+
-[Getting Started](#getting-started)
16
17
-[Introduction](#introduction)
17
18
-[Background](#background)
18
19
-[Project Build](#project-build)
@@ -46,16 +47,26 @@ Originally published on CodeProject at: <a href="https://www.codeproject.com/Art
46
47
47
48
Based on original design published in C\C++ Users Journal (Dr. Dobb's) at: <ahref="http://www.drdobbs.com/cpp/state-machine-design-in-c/184401236"><strong>State Machine Design in C++</strong></a>
48
49
49
-
<p><ahref="https://www.cmake.org/">CMake</a> is used to create the build files. CMake is free and open-source software. Windows, Linux and other toolchains are supported. See the <strong>CMakeLists.txt </strong>file for more information.</p>
50
-
51
50
## Related repositories
52
51
53
52
<ul>
54
-
<li><a href="https://github.com/endurodave/C_StateMachineWithThreads">C Language State Machine with Threads</a> - by David Lafreniere</li>
55
-
<li><a href="https://github.com/endurodave/C_Allocator">A Fixed Block Allocator in C</a> - by David Lafreniere</li>
56
-
<li><a href="https://github.com/endurodave/StateMachine">State Machine Design in C++</a> - by David Lafreniere</li>
53
+
<li><a href="https://github.com/endurodave/C_StateMachineWithThreads">C Language State Machine with Threads</a> - A C language state machine with OS threads.</li>
54
+
<li><a href="https://github.com/endurodave/C_Allocator">A Fixed Block Allocator in C</a> - A C language fixed block memory allocator.</li>
55
+
<li><a href="https://github.com/endurodave/StateMachine">State Machine Design in C++</a> - A C++ finite state machine (FSM) implementation.</li>
56
+
<li><a href="https://github.com/endurodave/StateMachineWithThreads">C++ State Machine with Threads</a> - A C++ state machine integrated with an asynchronous callback library.</li>
57
+
<li><a href="https://github.com/endurodave/StateMachineWithModernDelegates">C++ State Machine with Delegates</a> - A C++ state machine integrated with the <a href="https://github.com/endurodave/DelegateMQ">DelegateMQ</a> asynchronous delegate library.</li>
58
+
<li><a href="https://github.com/endurodave/AsyncStateMachine">Asynchronous State Machine in C++</a> - An asynchronous C++ state machine integrated with the <a href="https://github.com/endurodave/DelegateMQ">DelegateMQ</a> asynchronous delegate library.</li>
57
59
</ul>
58
60
61
+
# Getting Started
62
+
63
+
[CMake](https://cmake.org/) is used to create the project build files on any Windows or Linux machine. The state machine source code works on any C language compiler on any platform.
64
+
65
+
1. Clone the repository.
66
+
2. From the repository root, run the following CMake command:
67
+
`cmake -B Build .`
68
+
3. Build and run the project within the `Build` directory.
69
+
59
70
# Introduction
60
71
61
72
<p>In 2000, I wrote an article entitled "<em>State Machine Design in C++</em>" for C/C++ Users Journal (R.I.P.). Interestingly, that old article is still available and (at the time of writing this article) the #1 hit on Google when searching for C++ state machine. The article was written over 15 years ago, but I continue to use the basic idea on numerous projects. It's compact, easy to understand and, in most cases, has just enough features to accomplish what I need.</p>
0 commit comments