All Projects → zmij → Afsm

zmij / Afsm

Licence: artistic-2.0
C++14 Finite State Machine library

Programming Languages

cpp
1120 projects
cpp14
131 projects

Projects that are alternatives of or similar to Afsm

Fsm As Promised
A finite state machine library using ES6 promises
Stars: ✭ 446 (+294.69%)
Mutual labels:  state-machine, finite-state-machine, fsm
stateless
Finite State Machine porting from Stateless C#
Stars: ✭ 25 (-77.88%)
Mutual labels:  fsm, state-machine, finite-state-machine
Nanostate
🚦- Small Finite State Machines
Stars: ✭ 151 (+33.63%)
Mutual labels:  state-machine, finite-state-machine, fsm
Fluent State Machine
Fluent API for creating state machines in C#
Stars: ✭ 195 (+72.57%)
Mutual labels:  state-machine, finite-state-machine, fsm
pastafarian
A tiny event-based finite state machine
Stars: ✭ 20 (-82.3%)
Mutual labels:  fsm, state-machine, finite-state-machine
Finity
A finite state machine library for Node.js and the browser with a friendly configuration DSL.
Stars: ✭ 88 (-22.12%)
Mutual labels:  state-machine, finite-state-machine, fsm
Jstate
Advanced state machines in Java.
Stars: ✭ 84 (-25.66%)
Mutual labels:  state-machine, finite-state-machine, fsm
Django Fsm
Django friendly finite state machine support
Stars: ✭ 1,898 (+1579.65%)
Mutual labels:  state-machine, finite-state-machine, fsm
use-state-machine
Use Finite State Machines with React Hooks
Stars: ✭ 28 (-75.22%)
Mutual labels:  fsm, state-machine, finite-state-machine
xstate
State machines and statecharts for the modern web.
Stars: ✭ 21,286 (+18737.17%)
Mutual labels:  fsm, state-machine, finite-state-machine
Statecharts.github.io
There is no state but what we make. Feel free to pitch in.
Stars: ✭ 265 (+134.51%)
Mutual labels:  state-machine, finite-state-machine, fsm
UnityHFSM
A simple yet powerful class based hierarchical finite state machine for Unity3D
Stars: ✭ 243 (+115.04%)
Mutual labels:  fsm, state-machine, finite-state-machine
FiniteStateMachine
This project is a finite state machine designed to be used in games.
Stars: ✭ 45 (-60.18%)
Mutual labels:  fsm, state-machine, finite-state-machine
simple-state-machine
A simple Java state machine for Spring Boot projects
Stars: ✭ 25 (-77.88%)
Mutual labels:  fsm, state-machine, finite-state-machine
statemachine-go
🚦 Declarative Finite-State Machines in Go
Stars: ✭ 47 (-58.41%)
Mutual labels:  fsm, state-machine, finite-state-machine
use-tiny-state-machine
A tiny (~700 bytes) react hook to help you write finite state machines
Stars: ✭ 37 (-67.26%)
Mutual labels:  state-machine, finite-state-machine
Hsm
Finite state machine library based on the boost hana meta programming library. It follows the principles of the boost msm and boost sml libraries, but tries to reduce own complex meta programming code to a minimum.
Stars: ✭ 106 (-6.19%)
Mutual labels:  state-machine, finite-state-machine
fea state machines
A Buffet Of C++17 State Machines
Stars: ✭ 19 (-83.19%)
Mutual labels:  fsm, state-machine
Fsm
Finite State Machine for Go
Stars: ✭ 1,269 (+1023.01%)
Mutual labels:  finite-state-machine, fsm
Stateless4j
Lightweight Java State Machine
Stars: ✭ 658 (+482.3%)
Mutual labels:  finite-state-machine, fsm

Another Finite State Machine

afsm is a finite state machine C++14 library designed for usage in multithreaded asynchronous environment.

Inspiration and Motivation

The afsm library was inspired by ::boost::msm library and implemented so that the migration from ::boost::msm was a bunch of search and replace operations. The main motivation was to create a thread-safe FSM library and to achieve decent compile times for large and complex state machines not sacrificing performance. A state machine defined with afms library compiles several times faster than same library defined with ::boost::msm and has similar (or better) performance. You can find some benchmark results here.

Features

Planned features

  • State machine persistense

Synopsis

Here is a UML diagram of a trivial state machine and source code that it is mapped to. minimal

#include <afsm/fsm.hpp>
// Events
struct start {};
struct stop {};

// State machine definition
struct minimal_def : ::afsm::def::state_machine<minimal_def> {
    //@{
    /** @name States */
    struct initial      : state<initial> {};
    struct running      : state<running> {};
    struct terminated   : terminal_state<terminated> {};
    //@}

    using initial_state = initial;
    using transitions   = transition_table<
        /*  State       Event       Next        */
        tr< initial,    start,      running     >,
        tr< running,    stop,       terminated  >
    >;
};

// State machine object
using minimal = ::afsm::state_machine<minimal_def>;

void use()
{
    mimimal fsm;
    fsm.process_event(start{});
    fsm.process_event(stop{});
}

You can find a tutorial covering most of basic features here.

Documentation

Please see project wiki for documentation. TODO doxygen generated documentation.

Installation

The library is header only and doesn't requre build or installation. Just add the afsm/include and lib/meta/include directories under the root of this repository to your include paths.

CMake subproject

You can add the library to your project as a subtree, e.g. lib/afsm, and in your root CMakeLists.txt file just do the following:

add_subdirectory(lib/afsm)
include_directories(${AFSM_INCLUDE_DIRS})

TODO write docs on gitrc subtree commands and link to the repository

Installation to System Directories

git clone [email protected]:zmij/afsm.git
mkdir afsm/build
cd afsm/build
cmake ..
sudo make install

Finding the AFSM Package

find_package(AFSM REQUIRED) # Will set AFSM_INCLUDE_DIRS variable

License

The Artistic License 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].