Skip to content

ffunatsu/ofxBooLINQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ofxBooLINQ

boolinq for openFrameworks (tested on v0.12.0, boolinq version: 3.0.4)

Usage

See example. (Please use projectGenerator before run it)

#include "boolinq/boolinq.h"

struct Man {
    std::string name;
    int age;
};

using namespace boolinq;

void ofApp::setup(){
    ofLogToConsole();

    int src[] = {1,2,3,4,5,6,7,8};
    auto dst = from(src).where( [](int a) { return a % 2 == 1; })      // 1,3,5,7
                        .select([](int a) { return a * 2; })           // 2,6,10,14
                        .where( [](int a) { return a > 2 && a < 12; }) // 6,10
                        .toStdVector();

    ofLogNotice("ofApp") << "dst: " << ofToString(dst);
    
    Man src2[] = {
        {"Kevin",14},
        {"Anton",18},
        {"Agata",17},
        {"Terra",20},
        {"Layer",15},
    };

    auto dst2 = from(src2).where([](const Man & man) { return man.age < 18; })
                        .orderBy([](const Man & man) { return man.age; })
                        .select( [](const Man & man) { return man.name; })
                        .toStdVector();

    ofLogNotice("ofApp") << "dst2: " << ofToString(dst2);
}

// Result:
// [notice ] ofApp: dst: {6, 10}
// [notice ] ofApp: dst2: {Kevin, Layer, Agata}

LICENSE

NOTE: No specific copyright is claimed for this repository changes (for oF binding), but the Apache License 2.0 or MIT License can be applied if necessary.

About

boolinq for openFrameworks

Topics

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE.md
Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors