GithubHelp home page GithubHelp logo

kerwinzxc / pipeline Goto Github PK

View Code? Open in Web Editor NEW

This project forked from p-ranav/pipeline

0.0 0.0 0.0 251 KB

Pipelines for Modern C++

License: MIT License

C++ 56.12% Python 32.58% CMake 10.84% Shell 0.46%

pipeline's Introduction

Getting Started

pipeline is a C++17 header-only template library that lets you setup data processsing pipelines. Simply include <pipeline/pipeline.hpp> and you're good to go. There is also a single_include version in single_include/.

Let's start with the simple pipeline below. Wrap your functions using pipeline::fn and create a pipeline using the pipe (|) operator. Then simply call the pipeline to execute a sequence of functions.

#include <iostream>
#include <pipeline/pipeline.hpp>
using namespace pipeline;

int main() {
  auto add_2 = fn([](auto a, auto b) { return a + b; });
  auto print = fn([](auto result) { std::cout << result << "\n"; });
  
  auto pipeline = add_2 | print;
  
  pipeline(2, 3); // 5
}

Building Samples

git clone https://github.com/p-ranav/pipeline
cd pipeline
mkdir build && cd build
cmake -DPIPELINE_SAMPLES=ON ..
make

Generating Single Header

python3 utils/amalgamate/amalgamate.py -c single_include.json -s .

Contributing

Contributions are welcome, have a look at the CONTRIBUTING.md document for more information.

License

The project is available under the MIT license.

pipeline's People

Contributors

p-ranav avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.