{"id":18812154,"url":"https://github.com/drorspei/mountel","last_synced_at":"2025-10-28T05:03:46.815Z","repository":{"id":132912265,"uuid":"186708613","full_name":"drorspei/mountel","owner":"drorspei","description":"A state charts library for C++","archived":false,"fork":false,"pushed_at":"2019-05-14T22:49:04.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-30T00:14:30.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drorspei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-14T22:19:03.000Z","updated_at":"2019-05-14T22:49:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"84c293c2-13ba-4770-963b-001ace25dca2","html_url":"https://github.com/drorspei/mountel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drorspei%2Fmountel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drorspei%2Fmountel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drorspei%2Fmountel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drorspei%2Fmountel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drorspei","download_url":"https://codeload.github.com/drorspei/mountel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239748247,"owners_count":19690232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T23:29:58.887Z","updated_at":"2025-10-28T05:03:46.761Z","avatar_url":"https://github.com/drorspei.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mountel\nA state charts library for C++\n\nTaking inspiration from and combining code of the libraries uscxml, [boost]::sml, nbdl, and relying on the boost::hana meta programming library, to offer a convenient way to construct and use state charts in modern C++ code. The goal is to have the following compile, work as expected (if you're familiar with state charts), and be fast (at least as fast as the transpiled uscxml outputs):\n\n```C++\n#include \u003cmountel\u003e\n\nint main() {\n  using namespace mountel;\n  \n  struct done_init {\n    const int answer;\n  };\n  \n  const auto statechart = State(\n    Name(\"root\"_s),\n    States(\n      State(\n        Name(\"initializing\"_s),\n        Transition(\n          Event\u003cdone_init\u003e,\n          Target(\"waiting_for_question\"),\n          Guard([] (auto\u0026 sm, auto\u0026 e) { return e.answer \u003e 10; }),\n          Action(\n            [] (auto\u0026 sm, auto\u0026 e) {\n              std::printf(\"...? %d\\n\", e.answer);\n            }\n          )\n        )\n      ),\n      State(\n        Name(\"waiting_for_answer\"),\n        OnEnter(\n          [] { std::puts(\"entered waiting_for_answer\"); }\n        )\n      )\n    )\n  );\n  \n  auto machine = Machine(statechart);\n  machine.process(done_init{42});\n  \n  assert(machine.isin(\"waiting_for_answer\"));\n}\n```\n\n## Status of project:\n\nNo where near working.\n\nThe definition of state charts now compiles, and the guards/actions are saved and are callable.\n\nCan compute the number of states and transitions during compile time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrorspei%2Fmountel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrorspei%2Fmountel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrorspei%2Fmountel/lists"}