{"id":13729518,"url":"https://github.com/kenavolic/pipet","last_synced_at":"2025-05-08T01:32:50.188Z","repository":{"id":215948997,"uuid":"172989463","full_name":"kenavolic/pipet","owner":"kenavolic","description":"c++ library for building lightweight processing pipeline at compile-time for string obfuscation, aes ciphering or whatever you want","archived":false,"fork":false,"pushed_at":"2019-06-04T11:01:57.000Z","size":687,"stargazers_count":67,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-14T20:38:04.636Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/kenavolic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2019-02-27T21:00:24.000Z","updated_at":"2024-05-22T18:17:38.000Z","dependencies_parsed_at":"2024-01-24T19:16:04.764Z","dependency_job_id":null,"html_url":"https://github.com/kenavolic/pipet","commit_stats":null,"previous_names":["kenavolic/pipet"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenavolic%2Fpipet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenavolic%2Fpipet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenavolic%2Fpipet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenavolic%2Fpipet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenavolic","download_url":"https://codeload.github.com/kenavolic/pipet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252981716,"owners_count":21835468,"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-08-03T02:01:01.648Z","updated_at":"2025-05-08T01:32:49.575Z","avatar_url":"https://github.com/kenavolic.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# Pipet\r\n\r\n[![Build Status](https://travis-ci.org/kenavolic/pipet.svg?branch=master)](https://travis-ci.org/kenavolic/pipet)\r\n\r\nPipet is a lightweight c++17 headers-only library than can be used to build\r\nsimple processing pipelines at compile time.\r\n\r\n# Features\r\n\r\n  * Compile-time pipeline building from a set of user-defined filters\r\n  * Compile-time or runtime pipeline execution\r\n  * Creation of reversible pipelines (if all filters in the pipeline are reversible)\r\n  * Creation of branches (handling of multiple input filters)\r\n\r\n# Supported Platforms\r\n\r\nTests have been performed on the following platforms:\r\n\r\n  * g++-7 on linux (ci)\r\n  * clang++-7 (ci)\r\n\r\n# Install\r\n\r\n  * Clone project\r\n~~~\r\n    \u003e git clone https://github.com/kenavolic/pipet.git\r\n~~~\r\n\r\n  * Generate build system\r\n~~~\r\n    \u003e mkdir pipet_build\r\n    \u003e cd pipet_build\r\n    \u003e cmake -DCMAKE_INSTALL_PREFIX=$path_to_pipet_install_dir -DPIPET_BUILD_EXAMPLES=[ON|OFF] -DPIPET_BUILD_TESTS=[ON|OFF] ../pipet\r\n~~~\r\n\r\n  * Compilation\r\n~~~\r\n    \u003e make\r\n    \u003e make install\r\n~~~\r\n    + /!\\ On windows, open generated solution and build solution and install target\r\n\r\n\r\n# Usage\r\n\r\n## Examples\r\n\r\nThe projet include the following examples:\r\n\r\n* AES ciphering at compile time\r\n* String obfuscation at compile time\r\n* Mask generation at compile time\r\n\r\n## Import pipet to your project\r\n\r\n  * In your CMakeLists.txt, import pipet\r\n~~~\r\n    find_package(pipet REQUIRED)\r\n    ...\r\n    target_link_libraries(my_proj pipet::pipet)\r\n~~~\r\n\r\n  * Configure your project to find pipet package\r\n~~~\r\n    \u003e cmake -DCMAKE_PREFIX_PATH=$path_to_pipet_install_dir/cmake $path_to_your_proj_source_dir\r\n~~~\r\n\r\n## Implement a pipeline\r\n\r\nThe example directory provide two examples of pipet usage. Basically, all you need to do is:\r\n\r\n  * Create your filters with a static process and optionnaly static reverse function\r\n~~~       \r\n    struct filter\r\n    {\r\n        static constexpr out_type process(in_type my_param)\r\n        {\r\n            // do processing\r\n            return my_result;\r\n        }\r\n        \r\n        static constexpr in_type reverse(out_type my_param)\r\n        {\r\n            // do processing\r\n            return my_result;\r\n        }\r\n    };\r\n~~~\r\n\r\n  * Build your pipeline\r\n~~~\r\n    using my_processing_pipe = pipet::pipe\u003cfilter1, filter2, filter3\u003e;\r\n~~~\r\n\r\n  * Run it\r\n~~~\r\n    constexpr auto res = my_processing_pipe::process(); // if filter 1 is a data generator (no input type)\r\n    constexpr auto res = my_processing_pipe::process(var); // if filter 1 is processing filter\r\n~~~\r\n\r\n  * Create branches\r\n~~~\r\n  struct f1_proc_ct {\r\n    static constexpr auto process(int a) { return a; }\r\n  };\r\n\r\n  // compute a*a\r\n  struct f_square_ct {\r\n    static constexpr auto process(int a) { return a * a; }\r\n  };\r\n\r\n  // compute a*a*a\r\n  struct f_cube_ct {\r\n    static constexpr auto process(int a) { return a * a * a; }\r\n  };\r\n\r\n  // add 3 different inputs\r\n  struct f_add3_ct {\r\n    static constexpr auto process(int a, int b, int c) { return a + b + c; }\r\n  };\r\n\r\n  using branch1_t = pipet::pipe\u003cf1_proc_ct, f_square_ct\u003e;\r\n  using branch2_t = pipet::pipe\u003cf_cube_ct, f1_proc_ct\u003e;\r\n\r\n  // y = x*x + x*x + x*x*x\r\n  using pipe_with_branches_t =\r\n      pipet::pipe\u003cf1_proc_ct, pipet::branches\u003cbranch1_t, branch1_t, branch2_t\u003e,\r\n                  f_add3_ct\u003e;\r\n  \r\n  static_assert(pipe_with_branches_t::process(2) == 16,\r\n                \"[-][pipet_test] pipe processing failed\");\r\n~~~\r\n\r\n  * Create branches with a direct connection\r\n~~~\r\n  ... (see previous sample)\r\n\r\n  // y = x + x*x + x*x*x\r\n  using pipe_with_direct_branches_t = pipet::pipe\u003c\r\n      f1_proc_ct,\r\n      pipet::branches\u003cpipet::placeholders::self, branch1_t, branch2_t\u003e,\r\n      f_add3_ct\u003e;\r\n  static_assert(pipe_with_direct_branches_t::process(2) == 14,\r\n                \"[-][pipet_test] pipe processing failed\");\r\n\r\n~~~\r\n \r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenavolic%2Fpipet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenavolic%2Fpipet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenavolic%2Fpipet/lists"}