{"id":21186624,"url":"https://github.com/geontech/composite","last_synced_at":"2025-03-14T20:18:16.996Z","repository":{"id":257617400,"uuid":"856509768","full_name":"Geontech/composite","owner":"Geontech","description":"Lightweight framework for building streaming applications ","archived":false,"fork":false,"pushed_at":"2025-03-14T18:45:38.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-03-14T19:35:20.418Z","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":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Geontech.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":"2024-09-12T17:38:38.000Z","updated_at":"2025-03-03T13:01:47.000Z","dependencies_parsed_at":"2025-01-29T02:30:44.987Z","dependency_job_id":"74193c8d-0741-407b-92df-65daf0b65138","html_url":"https://github.com/Geontech/composite","commit_stats":null,"previous_names":["geontech/composite"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geontech%2Fcomposite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geontech%2Fcomposite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geontech%2Fcomposite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geontech%2Fcomposite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Geontech","download_url":"https://codeload.github.com/Geontech/composite/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243639557,"owners_count":20323511,"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-20T18:24:53.029Z","updated_at":"2025-03-14T20:18:16.983Z","avatar_url":"https://github.com/Geontech.png","language":"C++","readme":"# composite\n\n**composite** is a lightweight framework for building componentized streaming applications.\nIt provides a modular approach to constructing streaming workflows.\n\n## Features\n\n- **Modular Architecture**: Build applications by composing reusable components.\n- **Lightweight Design**: Minimal overhead ensures high performance in streaming scenarios.\n- **Efficient Memory Management**: Minimize copies with smart pointer movement between component ports.\n\n## Getting Started\n\n### Prerequisites\n\nEnsure you have the following installed:\n\n- [CMake](https://cmake.org/) (version 3.15 or higher)\n- A compatible C++ compiler (e.g., GCC, Clang) with C++20 support\n- OpenSSL (version 3.0 or higher) if compiling with  `-DCOMPOSITE_USE_OPENSSL=ON`\n\n### Build and Install\n\n```cmake\ncmake -B build\ncmake --build build [--parallel N]\ncmake --install build\n```\n\n### Build Options\n\n- `COMPOSITE_USE_NATS`: Enable components to publish data to a NATS server on a defined subject\n- `COMPOSITE_USE_OPENSSL`: Compile with OpenSSL support to enable a secure REST server\n\n## Component Interface\n\nThe **composite** framework is designed around a component-based architecture.\nEach component follows a well-defined interface that allows it to be integrated into a larger\nstreaming pipeline.\nThe key aspects of the component interface include:\n\n- **Configuration**: Components can be configured via properties, allowing for flexible runtime behavior.\n- **Initialization**: Components define an initialization phase where necessary resources are allocated.\n- **Data Processing**: Components process incoming data and produce outputs, which are streamed to downstream components.\n- **Lifecycle Management**: Each component follows a structured lifecycle, including creation, execution, and teardown.\n\n### Implementing a Component\n\nTo create a new component, developers must implement the required interface functions, ensuring\ncompatibility with the **composite** framework. Example:\n\n```cpp\n#include \u003ccomposite/component.hpp\u003e\n\nclass MyComponent : public composite::component {\n    using input_port_t = std::shared_ptr\u003cstd::vector\u003cstd::byte\u003e\u003e;\n    using output_port_t = input_port_t;\n\npublic:\n    MyComponent() : composite::component(\"MyComponent\") {\n        // Add ports to port set\n        add_port(m_in_port.get());\n        add_port(m_out_port.get());\n\n        // Add properties to configure\n        add_property(\"property_name\", \u0026m_property_name);\n    }\n\n    ~MyComponent() final = default;\n\n    // Implement the pure virtual function defined in composite::component\n    auto process() -\u003e composite::retval override {\n        using enum composite::retval;\n        \n        // Get data from an input port (if available)\n        auto [data, ts] = m_in_port-\u003eget_data();\n        if (data == nullptr) {\n            return NOOP;\n        }\n\n        // User-defined processing logic\n        // ...\n\n        // Send data via an output port\n        m_out_port-\u003esend_data(std::move(data), ts);\n        return NORMAL;\n    }\n\nprivate:\n    // Ports\n    std::unique_ptr\u003cinput_port_t\u003e m_in_port{std::make_unique\u003cinput_port_t\u003e(\"data_in\")};\n    std::unique_ptr\u003coutput_port_t\u003e m_out_port{std::make_unique\u003coutput_port_t\u003e(\"data_out\")};\n\n    // Properties\n    uint32_t m_property_name{};\n\n}; // class MyComponent\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeontech%2Fcomposite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeontech%2Fcomposite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeontech%2Fcomposite/lists"}