{"id":29264097,"url":"https://github.com/zigrazor/cxxstatetree","last_synced_at":"2025-08-31T20:11:00.735Z","repository":{"id":302117906,"uuid":"1011284562","full_name":"ZigRazor/CXXStateTree","owner":"ZigRazor","description":"A C++ Header-Only Hierarchical State Tree Library","archived":false,"fork":false,"pushed_at":"2025-07-14T17:25:08.000Z","size":1887,"stargazers_count":55,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-14T20:07:36.564Z","etag":null,"topics":["cpp","cpp-library","cpp20","gaming","header-only-library","state-machine","statetrees"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZigRazor.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,"zenodo":null}},"created_at":"2025-06-30T15:22:13.000Z","updated_at":"2025-07-14T17:25:08.000Z","dependencies_parsed_at":"2025-06-30T17:52:27.766Z","dependency_job_id":null,"html_url":"https://github.com/ZigRazor/CXXStateTree","commit_stats":null,"previous_names":["zigrazor/cxxstatetree"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZigRazor/CXXStateTree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZigRazor%2FCXXStateTree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZigRazor%2FCXXStateTree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZigRazor%2FCXXStateTree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZigRazor%2FCXXStateTree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZigRazor","download_url":"https://codeload.github.com/ZigRazor/CXXStateTree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZigRazor%2FCXXStateTree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273032934,"owners_count":25034067,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp","cpp-library","cpp20","gaming","header-only-library","state-machine","statetrees"],"created_at":"2025-07-04T12:09:46.785Z","updated_at":"2025-08-31T20:11:00.729Z","avatar_url":"https://github.com/ZigRazor.png","language":"C++","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/logo.png\" alt=\"CXXStateTree Logo\" width=\"200\"/\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eCXXStateTree\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\u003ci\u003eModern Hierarchical State Machine for C++20\u003c/i\u003e\u003c/p\u003e\n\n## 🚀 Features\n\n* 🔧 Fluent builder API with lambda-based DSL\n* ⚡ Fast runtime performance with zero heap allocation\n* 🛡️ Optional guards and actions for transitions\n* 🔄 Event-based state transitions\n* 🧪 Google Test integration\n* 📈 Code coverage with Codecov\n* 🌳 Designed for extensibility: nested states, DOT export coming soon\n* 🔧 Deployed as Shared Library and as Single Header-Only library\n\n---\n\n## 🛠️ Quick Example\n\n```cpp\n#include \u003ciostream\u003e\n#include \"CXXStateTree/StateTree.hpp\"\n\nusing namespace CXXStateTree;\n\nint main() {\n    auto machine = StateTree::Builder()\n        .initial(\"Idle\")\n        .state(\"Idle\", [](State\u0026 s) {\n            s.on(\"Start\", \"Running\", nullptr, []() {\n                std::cout \u003c\u003c \"Idle -\u003e Running\" \u003c\u003c std::endl;\n            });\n        })\n        .state(\"Running\", [](State\u0026 s) {\n            s.on(\"Stop\", \"Idle\", nullptr, []() {\n                std::cout \u003c\u003c \"Running -\u003e Idle\" \u003c\u003c std::endl;\n            });\n        })\n        .build();\n\n    machine.send(\"Start\");\n    machine.send(\"Stop\");\n}\n```\n\n---\n\n## 🛠️ Building Shared Library\n\n```bash\ncmake -S . -B build \ncmake --build build\n```\n\nAfter these command the Shared Library can be found in `build` directory\n\nPlease Note: in future release cmake will have the ability to install the library automatically, for now it is necessary to do it manually\n\n---\n\n## 🛠️ Building Single Header-Only Library\n\n```bash\ncmake -S . -B build -DENABLE_SINGLE_HEADER=ON\ncmake --build build\n```\n\nAfter these command the Single Header-Only Library can be found in `single_include` directory with the name CXXStateTree.hpp\n\nPlease Note: in future release cmake will have the ability to install the library automatically, for now it is necessary to do it manually\n\n---\n\n## 🧪 Running Tests\n\n```bash\ncmake -S . -B build -DENABLE_TEST=ON -DENABLE_COVERAGE=ON\ncmake --build build\ncd build \u0026\u0026 ctest\n```\n\n---\n\n## 📦 Dependencies\n\n* C++20 compiler (GCC \u003e= 10, Clang \u003e= 11, MSVC \u003e= 2019)\n* [GoogleTest](https://github.com/google/googletest) (auto-downloaded via CMake)\n\n---\n\n## 📈 Code Coverage\n\n[![codecov](https://codecov.io/gh/ZigRazor/CXXStateTree/graph/badge.svg?token=A1RP2ZDGI6)](https://codecov.io/gh/ZigRazor/CXXStateTree)\n\n---\n\n## 📂 Directory Structure\n\n```\nCXXStateTree/\n├── include/CXXStateTree/     # Public header-only API\n├── examples/                 # Usage examples\n├── tests/                    # Google Test suite\n├── CMakeLists.txt            # Project build\n└── .github/workflows/ci.yml  # GitHub Actions CI\n```\n\n---\n\n## 📋 License\n\nMPL2.0 License — see [LICENSE](LICENSE) for details.\n\n---\n\n## 🌟 Coming Soon\n\n* Nested (hierarchical) state support\n* DOT/Graphviz state diagram export\n* Transitions with context/parameters\n\n| Completed | Milestone   | Features                                                           |\n| :-: | :---------   | ------------------------------------------------------------------ |\n| :heavy_check_mark: | v0.1.0      | Basic state machine with `send()`, transitions, and state tracking |\n| :heavy_check_mark: | v0.2.0      | Guards and actions                                                 |\n| :heavy_check_mark: | v0.3.0      | Nested (hierarchical) states                                       |\n| :heavy_check_mark: | v0.4.0      | Graphviz export                                                    |\n| :memo: | v0.5.0      | Coroutine/async support (optional)                                 |\n| :memo: | v1.0.0      | Full unit test coverage, benchmarks, and docs                      |\n\n---\n\n## 👋 Contributions Welcome\n\nIssues, feature suggestions, and PRs are welcome!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigrazor%2Fcxxstatetree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzigrazor%2Fcxxstatetree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigrazor%2Fcxxstatetree/lists"}