Classes | Public Member Functions | Private Types | Private Attributes | List of all members
Adder Struct Reference
Inheritance diagram for Adder:

Classes

struct  f_body
 

Public Member Functions

 Adder (tbb::flow::graph &g)
 
int operator() (const vector< int > &in)
 

Private Types

typedef tbb::flow::composite_node< std::tuple< int, int >, std::tuple< int > > base_type
 

Private Attributes

tbb::flow::join_node< std::tuple< int, int >, queueing > j
 
tbb::flow::function_node< std::tuple< int, int >, int > f
 

Detailed Description

Definition at line 47 of file _test_tbb_composite.cxx.

Member Typedef Documentation

typedef tbb::flow::composite_node< std::tuple< int, int >, std::tuple< int > > Adder::base_type
private

Definition at line 50 of file _test_tbb_composite.cxx.

Constructor & Destructor Documentation

Adder::Adder ( tbb::flow::graph &  g)
inline

Definition at line 62 of file _test_tbb_composite.cxx.

62  : base_type(g), j(g), f(g, tbb::flow::unlimited, f_body() ) {
63  make_edge( j, f );
64  base_type::input_ports_type input_tuple(input_port<0>(j), input_port<1>(j));
65  base_type::output_ports_type output_tuple(f);
66  base_type::set_external_ports(input_tuple, output_tuple);
67  }
tbb::flow::function_node< std::tuple< int, int >, int > f
static const double g
Definition: Units.h:145
tbb::flow::composite_node< std::tuple< int, int >, std::tuple< int > > base_type
tbb::flow::join_node< std::tuple< int, int >, queueing > j

Member Function Documentation

int Adder::operator() ( const vector< int > &  in)
inline

Definition at line 89 of file test_tbb_join.cxx.

89  {
90  int tot=0;
91  std::string comma = "";
92  cerr << "Adding: ";
93  for (auto x : in) {
94  tot += x;
95  cerr << comma << x;
96  comma = " + ";
97  }
98  cerr << " = " << tot << "\n";
99  return tot;
100  }
std::string string
Definition: nybbler.cc:12
list x
Definition: train.py:276

Member Data Documentation

tbb::flow::function_node< std::tuple< int, int >, int > Adder::f
private

Definition at line 49 of file _test_tbb_composite.cxx.

tbb::flow::join_node< std::tuple<int, int>, queueing > Adder::j
private

Definition at line 48 of file _test_tbb_composite.cxx.


The documentation for this struct was generated from the following files: