{"id":28447592,"url":"https://github.com/henriktrom/cpp_utils","last_synced_at":"2026-05-15T20:04:55.427Z","repository":{"id":295815505,"uuid":"991307682","full_name":"HenrikTrom/cpp_utils","owner":"HenrikTrom","description":"A lightweight C++ utility module for multithreaded pipeline components and JSON handling. Includes a flexible StageBase class for real-time data processing and tools for loading, validating, and writing structured JSON files using RapidJSON.","archived":false,"fork":false,"pushed_at":"2025-06-18T14:08:54.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-20T06:07:44.259Z","etag":null,"topics":["cpp","json","multithreading","utils-library"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HenrikTrom.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"Citation.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-27T12:37:30.000Z","updated_at":"2025-06-18T14:08:57.000Z","dependencies_parsed_at":"2025-05-27T14:28:46.440Z","dependency_job_id":"0f60ec18-ad08-421d-a065-6788d989e66c","html_url":"https://github.com/HenrikTrom/cpp_utils","commit_stats":null,"previous_names":["henriktrom/cpp_utils"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/HenrikTrom/cpp_utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenrikTrom%2Fcpp_utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenrikTrom%2Fcpp_utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenrikTrom%2Fcpp_utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenrikTrom%2Fcpp_utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HenrikTrom","download_url":"https://codeload.github.com/HenrikTrom/cpp_utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenrikTrom%2Fcpp_utils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268185238,"owners_count":24209383,"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-01T02:00:08.611Z","response_time":67,"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","json","multithreading","utils-library"],"created_at":"2025-06-06T12:06:09.225Z","updated_at":"2026-05-15T20:04:55.422Z","avatar_url":"https://github.com/HenrikTrom.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧰 cpp-utils\n\n[![DOI](https://zenodo.org/badge/991307682.svg)](https://zenodo.org/badge/latestdoi/991307682)\n\nA lightweight C++ utility module for multithreaded pipeline components and JSON handling.\nIncludes a flexible `StageBase` class for real-time data processing and tools for loading, validating, and writing structured JSON files using [RapidJSON](https://github.com/Tencent/rapidjson).\n\nThis module is part of my  **ROS/ROS2** [real-time 3D tracker](https://github.com/HenrikTrom/real-time-3D-tracking) and its [docker-implementation](https://github.com/HenrikTrom/ROSTrack-RT-3D).\n\n## 📑 Citation\n\nIf you use this software, please use the GitHub **“Cite this repository”** button at the top(-right) of this page.\n\n## 🔧 Features\n\n### ✅ JSON Tools (`jsontools.h`)\n- Load and validate JSON documents with optional schema support\n- Save structured JSON objects to disk\n- Automatically timestamp JSON metadata\n- Scan directories for JSON or config files\n\n### 💻 Cli Tools (`clitools.h`)\n- Simple status bar\n\n### 📷 OpenCV Tools (`opencvtools.h`)\n- Batch Video Iterator, iterate over a batch of videos frame-by-frame\n\n### 🧵 StageBase Template\nA generic, thread-safe, multi-stage processing base class for building C++ pipelines.  \nFeatures:\n- Threaded input/output FIFOs\n- Customizable `ProcessFunction`\n- Hooks for completion callbacks\n- Runtime-safe termination and thread joining\n\n\u003e **Note**: The general layout of `StageBase` was developed as part of Cheng Minghao's PhD work.\n\n\n## Integration\n\nInclude this repo as a submodule or CMake interface library in larger projects, such as:\n\n- [flirmulticamera](https://github.com/HenrikTrom/flirmulticamera)\n- [detection-inference](https://github.com/HenrikTrom/detection_inference)\n- [pose-inference](https://github.com/HenrikTrom/pose_inference)\n\n\n## Dependencies\n\n- C++17\n- OpenCV 4.10.0\n- spdlog\n- [RapidJSON](https://github.com/Tencent/rapidjson) (included or linked)\n- Standard C++ libraries (`\u003cmutex\u003e`, `\u003cthread\u003e`, `\u003cqueue\u003e`, `\u003cchrono\u003e`, etc.)\n\n## Example Usage\n\n### Load and validate JSON\n\n```cpp\ncpp_utils::Document config;\ncpp_utils::load_json_with_schema(\"config.json\", \"schema.json\", 8192, config);\n````\n\n### Use the pipeline base\n\n```cpp\nclass MyStage : public cpp_utils::StageBase\u003cMyInput, MyOutput\u003e {\n    bool ProcessFunction(MyInput\u0026 input, MyOutput\u0026 output) override {\n        // process input -\u003e output\n        return true;\n    }\n};\n```\n\n## 👥 Acknowledgments\n\n* JSON loading and schema support based on [RapidJSON](https://github.com/Tencent/rapidjson)\n* Stage Base Template was initially designed in **Cheng Minghao's** PhD and adjusted for online-tracking.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenriktrom%2Fcpp_utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenriktrom%2Fcpp_utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenriktrom%2Fcpp_utils/lists"}