{"id":19330531,"url":"https://github.com/teiacare/teiacaresdk","last_synced_at":"2025-04-22T23:31:24.646Z","repository":{"id":226588617,"uuid":"769068881","full_name":"TeiaCare/TeiaCareSDK","owner":"TeiaCare","description":"TeiaCareSDK is a collection of reusable C++ components","archived":false,"fork":false,"pushed_at":"2025-03-22T00:34:10.000Z","size":1036,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-02T04:47:22.036Z","etag":null,"topics":["cpp","cross-platform","datetime","geometry","high-performance","multithreading","sdk","utilities"],"latest_commit_sha":null,"homepage":"https://teiacare.github.io/TeiaCareSDK/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TeiaCare.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","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":"2024-03-08T09:26:38.000Z","updated_at":"2025-03-22T00:34:14.000Z","dependencies_parsed_at":"2024-05-04T00:27:34.057Z","dependency_job_id":"bcf4fce7-9fc5-4337-9c0e-20ab9eac3859","html_url":"https://github.com/TeiaCare/TeiaCareSDK","commit_stats":null,"previous_names":["teiacare/teiacaresdk"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeiaCare%2FTeiaCareSDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeiaCare%2FTeiaCareSDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeiaCare%2FTeiaCareSDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeiaCare%2FTeiaCareSDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TeiaCare","download_url":"https://codeload.github.com/TeiaCare/TeiaCareSDK/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250340180,"owners_count":21414492,"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":["cpp","cross-platform","datetime","geometry","high-performance","multithreading","sdk","utilities"],"created_at":"2024-11-10T02:36:59.375Z","updated_at":"2025-04-22T23:31:24.639Z","avatar_url":"https://github.com/TeiaCare.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TeiaCareSDK\r\n\r\nWelcome to TeiaCareSDK!\r\n\r\nTeiaCareSDK is a collection of reusable C++ components.\r\n\r\n[![Docs](https://img.shields.io/badge/Docs-TeiaCareSDK-white.svg)](https://teiacare.github.io/TeiaCareSDK/)\r\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ba48b0836d884c969b94b314901b95ff)](https://app.codacy.com/gh/TeiaCare/TeiaCareSDK/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\r\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/ba48b0836d884c969b94b314901b95ff)](https://app.codacy.com/gh/TeiaCare/TeiaCareSDK/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_coverage)\r\n[![codecov](https://codecov.io/gh/TeiaCare/TeiaCareSDK/branch/develop/graph/badge.svg?token=EFEW3J454E)](https://codecov.io/gh/TeiaCare/TeiaCareSDK)\r\n\r\n![TeiaCareSDK](https://socialify.git.ci/TeiaCare/TeiaCareSDK/image?description=1\u0026font=Raleway\u0026name=1\u0026pattern=Solid\u0026theme=Auto)\r\n\r\n## Key Features\r\n\r\n* **Date \u0026 Time:** Master dates, times, and durations with ease using dedicated classes for manipulation, validation, formatting, conversions, timezones, and arithmetic operations.\r\n* **Concurrency:** Take control of concurrent execution with thread-safe modules for managing tasks, queues, events, and thread pools, enabling efficient parallel processing.\r\n* **Synchronization \u0026 Control:** Maintain data integrity and program flow with modules for rate limiting, observing data changes, and accurately measuring elapsed time, ensuring thread safety and coordinated execution.\r\n* **Platform Agnostic:** Benefit from cross-platform compatibility with modules that adapt to your system's specifics, like version information, guaranteeing seamless code execution across different environments.\r\n* **Singletons \u0026 Services:** Create and manage global instances effectively with a dedicated module, and organize your application logic with a service locator, achieving centralized access to essential services and a clean code structure.\r\n* **Enhanced Code Safety:** Enforce best practices with base classes that prevent copying and moving objects, use a module to signal unexpected code paths, and leverage metaprogramming techniques for function analysis in unit testing, promoting robust and secure code.\r\n* **Unique Identifier Generation:** Easily generate and manage Universally Unique Identifiers (UUIDs) with dedicated classes, allowing for effortless creation and tracking of unique identifiers for your entities.\r\n* **Additional Utilities:** Discover more functionality with various modules like tasks, clocks, and observers, providing a broad spectrum of tools to address diverse development needs and enhance your applications.\r\n\r\n\r\n## Why Choose TeiaCareSDK?\r\n\r\n* **Modular Design:** Pick and choose the modules you need, keeping your project lean and focused.\r\n* **Clear Documentation:** Comprehensive documentation with examples ensures smooth onboarding and understanding.\r\n* **Active Community:** Engage with our community for support, feedback, and collaboration.\r\n* **Tested \u0026 Reliable:** Enjoy peace of mind with well-tested and actively maintained code with mature CI/CD workflows.\r\n* **Production Quality:** TeiaCareSDK runs in production environment serving thousands of devices on a daily basis.\r\n\r\n\r\n## Supported Configurations\r\n\r\nAzure DevOps build matrix is available [here](https://dev.azure.com/teiacare/TeiaCare/_build?definitionId=91\u0026_a=summary).\r\n\r\n| **OS**               | **Compiler**       | **Debug** | **Release** | **RelWithDebInfo** |\r\n|----------------------|--------------------|:---------:|:-----------:|:------------------:|\r\n| Windows Server 2022  | Visual Studio 2022 |  [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=Debug\u0026configuration=Debug%20windows2022_msvc2022)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) |[![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=Release\u0026configuration=Release%20windows2022_msvc2022)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=RelWithDebInfo\u0026configuration=RelWithDebInfo%20windows2022_msvc2022)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) |\r\n| Windows Server 2019  | Visual Studio 2019 | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=Debug\u0026configuration=Debug%20windows2019_msvc2019)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=Release\u0026configuration=Release%20windows2019_msvc2019)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=RelWithDebInfo\u0026configuration=RelWithDebInfo%20windows2019_msvc2019)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) |\r\n| MacOS 14 Sonoma      | Apple-Clang 15     | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=Debug\u0026configuration=Debug%20macos14_clang15)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=Release\u0026configuration=Release%20macos14_clang15)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=RelWithDebInfo\u0026configuration=RelWithDebInfo%20macos14_clang15)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) |\r\n| Ubuntu 22.04         | GCC 12             | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=Debug\u0026configuration=Debug%20ubuntu2204_gcc12)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=Release\u0026configuration=Release%20ubuntu2204_gcc12)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=RelWithDebInfo\u0026configuration=RelWithDebInfo%20ubuntu2204_gcc12)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) |\r\n| Ubuntu 22.04         | Clang 15           | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=Debug\u0026configuration=Debug%20ubuntu2204_clang15)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=Release\u0026configuration=Release%20ubuntu2204_clang15)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) | [![Build Status](https://dev.azure.com/teiacare/TeiaCare/_apis/build/status%2FTeiaCareSDK?branchName=develop\u0026jobName=RelWithDebInfo\u0026configuration=RelWithDebInfo%20ubuntu2204_clang15)](https://dev.azure.com/teiacare/TeiaCare/_build/latest?definitionId=91\u0026branchName=develop) |\r\n| Ubuntu 24.04         | GCC 14             | 🚧 | 🚧 | 🚧 |\r\n| Ubuntu 24.04         | Clang 18           | 🚧 | 🚧 | 🚧 |\r\n\r\n\r\n## Try online on Wandbox\r\n\r\n[![Try Online](https://img.shields.io/badge/Wandbox-ok?style=plastic\u0026label=Try%20Online\u0026link=https%3A%2F%2Fimg.shields.io%2Fwandbox.org%2Fpermlink%2FsfU3VY4HFMBZp8QI)](https://wandbox.org/permlink/sfU3VY4HFMBZp8QI)\r\n\r\n```cpp\r\n#include \u003ciostream\u003e\r\n#include \"teiacare/sdk/observable.hpp\"\r\n\r\nint main()\r\n{\r\n    auto callback = [](int value){ std::cout \u003c\u003c \"Update: \" \u003c\u003c value \u003c\u003c \"\\n\"; };\r\n    auto observable = tc::sdk::observable\u003cint\u003e(-1, callback);\r\n\r\n    constexpr int total_updates = 10;\r\n    for (int i = 0; i \u003c total_updates; ++i)\r\n    {\r\n        observable = i; // Trigger updates\r\n    }\r\n\r\n    return 0;\r\n}\r\n```\r\n\r\nCheck the [Examples](sdk/examples/src/) folder for an in-depth showcase of all the features of this library.\r\n\r\n\r\n## Getting Started\r\n\r\nThis project uses git submodules so it is required to clone it using the *--recurse-submodules* flag in order to retrive the required submodules.\r\n\r\n```bash\r\ngit clone --recurse-submodules https://github.com/TeiaCare/TeiaCareSDK.git\r\ngit submodule update --init\r\n```\r\n\r\n### Create Development Environment\r\nIn order to setup a development environment it is sufficient to run the script *scripts/env/setup.\u003cbat|sh\u003e* depending on your operating system.\r\n\r\n```bash\r\n# Linux/MacOS\r\nchmod +x scripts/env/setup.sh\r\nscripts/env/setup.sh\r\n\r\n# Windows\r\nscripts\\env\\setup.bat\r\n```\r\n\r\n### Start Development Environment\r\nIn order to start the development environment it is sufficient to activate the Python Virtual Environment just created the step above.\r\n\r\n```bash\r\n# Linux/MacOS\r\nsource .venv/bin/activate\r\n\r\n# Windows\r\n.venv\\Scripts\\activate.bat\r\n```\r\n\r\n### Setup Build Environment (Windows Only)\r\n\r\nWhen building from command line on Windows it is necessary to activate the Visual Studio Developer Command Prompt.\r\n\r\nDepending on the version of Visual Studio compiler and on its install location it is required to run *vcvars64.bat* script the set the development environment properly.\r\n\r\n*Note*: using Visual Studio IDE or the CMake extension for VSCode this step is already managed in the background, so no action is required.\r\n\r\nExamples:\r\n\r\n```bash\r\n# Visual Studio 2022 - Build Tools\r\n\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat\"\r\n\r\n# Visual Studio 2019 - Enterprise\r\n\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat\"\r\n```\r\n\r\n### Setup Dependencies\r\nThis script must be executed in order to install the 3rd party dependencies specified in the conanfile (note that 3rd party libs are only required for unit tests, examples and benchmarks).\r\n\r\nSee the section [Scripts Parameters](#scripts-parameters) for more details on the allowed scripts parameters.\r\n\r\n```bash\r\npython scripts/conan/setup.py \u003cDebug|Release|RelWithDebInfo\u003e \u003cCOMPILER_NAME\u003e \u003cCOMPILER_VERSION\u003e\r\n\r\n# examples:\r\npython scripts/conan/setup.py Debug visual_studio 17\r\npython scripts/conan/setup.py Release clang 15\r\n```\r\n\r\n### Configure, Build and Install\r\n\r\nThis script configures, builds and installs the library.\r\n```bash\r\npython scripts/cmake.py \u003cDebug|Release|RelWithDebInfo\u003e \u003cCOMPILER_NAME\u003e \u003cCOMPILER_VERSION\u003e\r\n```\r\n\r\n## Examples\r\n\r\n```bash\r\n# Build all the examples\r\npython scripts/cmake.py \u003cDebug|Release|RelWithDebInfo\u003e \u003cCOMPILER_NAME\u003e \u003cCOMPILER_VERSION\u003e --examples --warnings\r\n\r\n# Run all the examples\r\npython3 scripts/tools/run_examples.py install/examples\r\n```\r\nExamples are installed in $PWD/install/examples.\r\n\r\n\r\n## Unit Tests and Code Coverage\r\n\r\n```bash\r\n# Build Unit Tests with Code Coverage enabled (if supported)\r\npython scripts/cmake.py \u003cDebug|Release|RelWithDebInfo\u003e \u003cCOMPILER_NAME\u003e \u003cCOMPILER_VERSION\u003e --coverage --warnings\r\n\r\n# Run Unit Tests\r\npython scripts/tools/run_unit_tests.py \u003cDebug|Release|RelWithDebInfo\u003e\r\n\r\n# Run Code Covergae\r\npython scripts/tools/run_coverage.py \u003cCOMPILER_NAME\u003e \u003cCOMPILER_VERSION\u003e sdk --extra_args=-e=sdk/src/datetime/date.h\r\n```\r\nNote that code coverage is not available on Windows.\r\n\r\nUnit tests results are available in $PWD/results/unit_tests.\r\nCoverage results are available in $PWD/results/coverage.\r\n\r\n\r\n## Benchmarks\r\n\r\n```bash\r\npython scripts/cmake.py \u003cDebug|Release|RelWithDebInfo\u003e \u003cCOMPILER_NAME\u003e \u003cCOMPILER_VERSION\u003e --benchmarks --warnings\r\npython scripts/tools/run_benchmarks.py \u003cCOMPILER_NAME\u003e \u003cCOMPILER_VERSION\u003e\r\n```\r\nBenchmarks are installed in $PWD/install/benchmarks.\r\n\r\n\r\n## Code Formatting\r\n\r\n[clang-format](https://clang.llvm.org/docs/ClangFormat.html)\r\n\r\n*clang-format* can be installed via *pip* using the provided *scripts/requirements.txt*\r\n\r\n```bash\r\npython scripts/tools/run_clang_format.py sdk\r\n```\r\n\r\n\r\n## Code Analysis\r\n\r\n[clang-tidy](https://clang.llvm.org/extra/clang-tidy/)\r\n\r\n*clang-tidy* can be installed via *pip* using the provided *scripts/requirements.txt*\r\n\r\n```bash\r\npython scripts/tools/run_clang_tidy.py -header-filter=.* sdk\r\n```\r\n\r\n[cppcheck](http://cppcheck.net/)\r\n\r\nFirst install and setup *cppcheck* from your OS package manager.\r\n```bash\r\n# Linux\r\nsudo apt install cppcheck\r\n\r\n# Windows\r\nwinget install cppcheck\r\n```\r\n\r\nThen run CppCheck using the provided python script:\r\n```bash\r\npython scripts/tools/run_cppcheck.py \u003cDebug|Release|RelWithDebInfo\u003e\r\n```\r\n\r\n\r\n## Generate Documentation\r\n\r\nFirst install and setup *Doxygen* from your OS package manager.\r\n```bash\r\n# Linux\r\napt-get install doxygen graphviz\r\n\r\n# Windows\r\nwinget install doxygen\r\n```\r\n\r\nThen run Doxygen using the provided python script:\r\n```bash\r\npython scripts/tools/run_doxygen.py\r\n```\r\nDocumentation is now installed in $PWD/docs.\r\n\r\n## Conan Package\r\n\r\n### Local Install\r\n\r\nCreate, test and install local package.\r\n\r\nNotes:\r\n\r\n1) The install directory path must be a valid Conan cache (i.e. \".conan\" folder) located in the current directory.\r\n   So, in order to install the package in a desired repository folder, it is required to run this script from the repository folder directly.\r\n2) The Conan package tests are automatically run during package creation.\r\n   The directory test_package contains a test project that is built to validate the proper package creation.\r\n\r\n```bash\r\n# Create the Conan package locally\r\npython scripts/conan/create.py \u003cDebug|Release|RelWithDebInfo\u003e \u003cCOMPILER_NAME\u003e \u003cCOMPILER_VERSION\u003e\r\n\r\n# Build and install the test package executable\r\npython test_package/build.py \u003cDebug|Release|RelWithDebInfo\u003e \u003cCOMPILER_NAME\u003e \u003cCOMPILER_VERSION\u003e\r\n\r\n# Run the test package executable\r\n$PWD/install/test_package/teiacare_sdk_test_package\r\n```\r\n\r\n\r\n### Artifactory Upload\r\n\r\nIn order to upload a Conan package to TeiaCare Artifactory server it is required to setup you local Conan client once with the following commands:\r\n\r\n```bash\r\n# Add TeiaCare Artifactory remote to local Conan client\r\nconan remote add teiacare $(artifactory.url)/teiacare\r\n\r\n# Authenticate with Artifactory credentials\r\nconan user $(artifactory.username) -p $(artifactory.password) -r teiacare\r\n```\r\n\r\nNow it is possible to create and upload a Conan package with the following commands:\r\n\r\n```bash\r\n# Create the Conan package locally\r\npython scripts/conan/create.py \u003cDebug|Release|RelWithDebInfo\u003e \u003cCOMPILER_NAME\u003e \u003cCOMPILER_VERSION\u003e\r\n\r\n# Upload the package to Artifactory on the teicare remote\r\npython scripts/conan/upload.py teiacare teiacare_sdk/\u003cPACKAGE_VERSION\u003e@\r\n```\r\n\r\n\r\n## Contributing\r\n\r\nIn order to contribute to TeiaCareSDK, please follow our [contribution guidelines](./CONTRIBUTING).\r\n\r\n[![Contributions](https://img.shields.io/badge/Contributions-Welcome-green.svg)](./CONTRIBUTING)\r\n\r\n\r\n## License\r\n\r\nThis project is licensed under the [Apache License, Version 2.0](./LICENSE).\r\n\r\n[![License](https://img.shields.io/badge/License-Apache_v2-blue)](./LICENSE)\r\n\r\nCopyright © 2024 [TeiaCare](https://teiacare.com/)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteiacare%2Fteiacaresdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteiacare%2Fteiacaresdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteiacare%2Fteiacaresdk/lists"}