#include <tbb/flow_graph.h>
#include <iostream>
#include <tuple>
#include <chrono>
#include <thread>
Go to the source code of this file.
|
typedef dfp::multifunction_node< int, tbb::flow::tuple< float > > | int2float_node |
|
typedef dfp::multifunction_node<int, tbb::flow::tuple<float> > int2float_node |
Definition at line 50 of file test_tbb.cxx.
52 std::vector<int> numbers{5,4,3,2,1,0};
54 dfp::function_node<int, int> int_chirp_node(g, dfp::unlimited, [](
const int &v) {
55 cerr <<
"i value: " << v <<
endl;
57 cerr <<
"...woke, returning i=" << v <<
endl;
60 dfp::function_node<float,float> float_chirp_node(g, dfp::unlimited, [](
const float &v) {
61 cerr <<
"f value: " << v <<
endl;
63 cerr <<
"...woke, returning f=" << v <<
endl;
68 cerr <<
"make edges" <<
endl;
69 make_edge(number_source_node, int_chirp_node);
70 make_edge(int_chirp_node, i2fcaster_node);
71 make_edge(dfp::output_port<0>(i2fcaster_node), float_chirp_node);
73 cerr <<
"Activate source" <<
endl;
74 number_source_node.activate();
75 cerr <<
"Waiting for graph" <<
endl;
def graph(desc, maker=maker)
dfp::multifunction_node< int, tbb::flow::tuple< float > > int2float_node
QTextStream & endl(QTextStream &s)
Definition at line 45 of file test_tbb.cxx.
millisecond milliseconds
Alias for common language habits.