{"id":13807598,"url":"https://github.com/scramjetorg/framework-cpp","last_synced_at":"2025-02-22T13:57:30.088Z","repository":{"id":103293938,"uuid":"397372480","full_name":"scramjetorg/framework-cpp","owner":"scramjetorg","description":"Simple yet powerful live data computation framework. C++ port of Scramjet framework.","archived":false,"fork":false,"pushed_at":"2022-09-09T10:33:56.000Z","size":212,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-01-03T09:19:27.902Z","etag":null,"topics":["cpp","data-stream","event-stream","reactive-programming","scramjet","spark-streaming","stream","stream2","transformations"],"latest_commit_sha":null,"homepage":"","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/scramjetorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":"scramjetorg"}},"created_at":"2021-08-17T19:39:58.000Z","updated_at":"2022-12-23T10:08:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d2628e5-a6ca-4796-875e-d4de0eacd301","html_url":"https://github.com/scramjetorg/framework-cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"TheLartians/ModernCppStarter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scramjetorg%2Fframework-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scramjetorg%2Fframework-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scramjetorg%2Fframework-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scramjetorg%2Fframework-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scramjetorg","download_url":"https://codeload.github.com/scramjetorg/framework-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240183761,"owners_count":19761439,"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","data-stream","event-stream","reactive-programming","scramjet","spark-streaming","stream","stream2","transformations"],"created_at":"2024-08-04T01:01:27.409Z","updated_at":"2025-02-22T13:57:30.050Z","avatar_url":"https://github.com/scramjetorg.png","language":"C++","readme":"Scramjet Framework C++\n==================\n\n\u003cp align=\"center\"\u003e\n    \u003ca\u003e\u003cimg src=\"https://img.shields.io/github/license/scramjetorg/framework-cpp?color=green\u0026style=plastic\" alt=\"GitHub license\" /\u003e\u003c/a\u003e\n    \u003ca\u003e\u003cimg src=\"https://img.shields.io/github/v/tag/scramjetorg/framework-cpp?label=version\u0026color=blue\u0026style=plastic\" alt=\"version\" /\u003e\u003c/a\u003e\n    \u003ca\u003e\u003cimg src=\"https://img.shields.io/github/stars/scramjetorg/framework-cpp?color=pink\u0026style=plastic\" alt=\"GitHub stars\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=7F7V65C43EBMW\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Donate-PayPal-green.svg?color=yellow\u0026style=plastic\" alt=\"Donate\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e⭐ Star us on GitHub — it motivates us a lot! 🚀 \u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://assets.scramjet.org/images/framework-logo-256.svg\" width=\"420\" alt=\"Scramjet Framework\"\u003e\n\u003c/p\u003e\n\nScramjet is a simple reactive stream programming framework. The code is written by chaining functions that transform the streamed data, including well known map, filter and each.\n\nThe main advantage of Scramjet is running asynchronous operations on your data streams concurrently. It allows you to perform the transformations both synchronously and asynchronously by using the same API - so now you can \"map\" your stream from whatever source and call any number of API's consecutively.\n\n[Originally written](https://github.com/scramjetorg/scramjet) on top of node.js\nobject streams, Scramjet is now being ported into C++. This is what is\nhappening in this repository. There is also [JavaScript/TypeScript](https://github.com/scramjetorg/framework-js) and [Python](https://github.com/scramjetorg/framework-python) version available.\n\n**We are open to your feedback!** We encourage you to report issues with any ideas, suggestions and features you would like to see in this version. You can also upvote (`+1`) existing ones to show us the direction we should take in developing Scramjet Framework.\n\n## Table of contents\n\n- [Scramjet Framework C++](#scramjet-framework-c)\n  - [Table of contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [Requesting Features](#requesting-features)\n  - [Reporting bugs](#reporting-bugs)\n  - [Contributing](#contributing)\n  - [Development Setup](#development-setup)\n\n## Installation\n\nTo use Ifca interface library just clone framework-cpp repository and add include directory to your project then simply include headers of your need.\n\n## Usage\n\nWrite and read chunks:\n      \n```C++\nstd::shared_future\u003cvoid\u003e write(Chunk chunk)\n```\n- writes chunk of type Chunk to ifca algorithm (must be the same type as input type of first transform). Returns drain state- if we've surpressed [maxParallel] chunk processed, it will return shared_future to wait for draining stream, otherwise returns already set shared_future.\n\n```C++\nstd::future\u003cOutputType\u003e read()\n```\n- Returns future of processed chunk of type OutputType- type returned by last transform in chain. Future is set after transformations are finished.\n\nTransform chunks:\n\nTo add Transform to processing chain use:\n```C++\n addTransform(Transform)\n```\nTransforms accept any callable object having operator(ChunkType value) overloaded- functions, member functions, lambdas, std::function, functional objects.\n\nPossible values are:\n```C++\n each(Callable function)\n```\n- Calls Callable(chunk) and passes result of callable further. \n```C++\n map(Callable function)\n```\n- Calls Callable(chunk) and passes same chunk further without taking result of callable.\n```C++\n filter(Predicate function)\n```\n- Calls Predicate(chunk)- must return bool value. If predicate is true passes chunk further, otherwise filters out chunk from flow.\n\nExample usage:\n```C++\n  // for readability only\n  using namespace ifca; \n\n  auto incrementByOne = [](int chunk) {\n    return chunk + 1;\n  };\n  auto showChunk = [](int chunk) {\n    std::cout \u003c\u003c chunk \u003c\u003c \"\\n\";\n    return chunk;\n  };\n  auto filterOddChunk = [](int chunk){\n      return (chunk % 2 == 0);\n  }\n\n  const unsigned int maxParallel = 8;\n  \n  auto ifca = Ifca().addTransform(map(incrementByOne)).addTransform(each(showChunk)).addTransform(filter(filterOddChunk));\n\n  auto inputReader = std::async(std::launch::async, [\u0026]() {\n    int c;\n    while (std::cin \u003e\u003e c) {\n      ifca.write(c).wait();\n    }\n    ifca.end();\n  });\n\n  auto outputReader = std::async(std::launch::async, [\u0026]() {\n      while (true) \n        std::cout \u003c\u003c ifca.read().get();\n  });\n  outputReader.wait();\n\n```\n\n## Requesting Features\n\nAnything missing? Or maybe there is something which would make using Scramjet Framework much easier or efficient? Don't hesitate to fill up a [new feature request](https://github.com/scramjetorg/framework-cpp/issues/new)! We really appreciate all feedback.\n\n## Reporting bugs\n\nIf you have found a bug, inconsistent or confusing behavior please fill up a [new bug report](https://github.com/scramjetorg/framework-cpp/issues/new).\n\n## Contributing\n\nYou can contribute to this project by giving us feedback ([reporting bugs](#reporting-bugs) and [requesting features](#reporting-features)) and also by writing code yourself!\n\nThe easiest way is to [create a fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) of this repository and then [create a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) with all your changes. In most cases, you should branch from and target `main` branch.\n\nPlease refer to [Development Setup](#development-setup) section on how to setup this project.\n\n## Development Setup\n\n1\\. Clone this repo:\n\n```bash\ngit@github.com:scramjetorg/framework-cpp.git\n```\n\n2\\. List presets available on your OS:\n\n```bash\ncmake --list-presets=all .\n```\n\nIt will result with a similar list:\n\n```bash\nAvailable configure presets:\n\n  \"linux-debug\"         - Linux Debug\n  \"linux-test-coverage\" - Linux Test Coverage\n  \"linux-release\"       - Linux Release\n```\n\n3\\. Build `make` according to specific preset:\n\n```bash\ncmake --preset linux-debug\n```\n\n4\\. Build project using `make` file from previous step:\n\n```bash\ncd out/build/linux-debug/\ncmake --build .\n```\n\n5\\. Run tests (only debug presets)\n\n```bash\n./tests/IFCA_tests\n```\n\n5\\. Run code coverage raport:\n\n```bash\ncmake --preset linux-test-coverage\ncd out/build/linux-test-coverage\nmake IFCA_coverage\n```\n\nRaport will be under `out/build/linux-test-coverage/IFCA-coverage` folder, open `index.html` file to check specific results.\n","funding_links":["https://github.com/sponsors/scramjetorg","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=7F7V65C43EBMW"],"categories":["Table of Contents"],"sub_categories":["Streaming Library"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscramjetorg%2Fframework-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscramjetorg%2Fframework-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscramjetorg%2Fframework-cpp/lists"}