Skip to content

Commit

Permalink
README: document basic features
Browse files Browse the repository at this point in the history
  • Loading branch information
multun committed Oct 7, 2018
1 parent 2e20c1f commit aa886c3
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Introduction

A library for making state machines :
- no dynamic allocation needed
- all states will share a common interface, which may then be used to interact
with states
- transitionning between states is a safe operation (memory owne by the former
state is still valid when constructing the new one)
- a list of allowed transitions can be used to restrict what state changes are
allowed
- one may log state transitions
- states are reusable

# Usage

See `test.cc`

# Limitations

- When transitionning from a state to another, a deduction guide must be given
for the checker to know from which state the transition comes from. It may be
"fixed" by introducing a state identifier, which is super easy but adds a
performance overhead for little apparent benefit. Introducing a proxy class
which has friendly access for proxying transitions to the automaton sort of
solves the problem, but makes the syntax heavier.
- transitionning to a new state while already constructing a state is undefined
behavior

# FAQ

`is it production ready ?`
No, it's a toy, the almost untested™ kind

`Where's the build system ?`
That's like two header files, what would you like to build ?

0 comments on commit aa886c3

Please sign in to comment.