Midge  v3.9.2
Data Processing Framework
producer.hh
Go to the documentation of this file.
1 #ifndef _midge_producer_hh_
2 #define _midge_producer_hh_
3 
4 #include "_out.hh"
5 #include "node.hh"
6 #include "typeat.hh"
7 #include "typechain.hh"
8 
9 namespace midge
10 {
11 
12  class producer :
13  virtual public node
14  {
15  protected:
16  producer();
17 
18  public:
19  virtual ~producer();
20 
21 
22  };
23 
24  template< class x_out_list >
25  class _producer;
26 
27  template< template<class...> class x_out_list, class... x_out_types >
28  class _producer< x_out_list<x_out_types...> > :
29  public producer,
30  public type_start_chain< _out< _type, _index >, x_out_types... >
31  {
32  public:
33  using node::out;
34 
35  public:
36  _producer();
37  virtual ~_producer();
38 
39  protected:
40  template< int x_index >
41  _stream< type_at< x_index, x_out_types... > >& out_stream()
42  {
43  return this->_out< type_at< x_index, x_out_types... >, type_int< x_index > >::get_stream();
44  }
45 
46  template< int x_index >
47  _buffer< type_at< x_index, x_out_types... > >& out_buffer()
48  {
49  return this->_out< type_at< x_index, x_out_types... >, type_int< x_index > >::get_buffer();
50  }
51  };
52 
53  template< template<class...> class x_out_list, class... x_out_types >
54  _producer< x_out_list<x_out_types...> >::_producer() :
55  producer(),
56  type_start_chain< _out< _type, _index >, x_out_types... >()
57  {
58  }
59  template< template<class...> class x_out_list, class... x_out_types >
60  _producer< x_out_list<x_out_types...> >::~_producer()
61  {
62  }
63 
64 }
65 
66 #endif
Definition: _buffer.hh:11
typename type_at_impl< x_index, x_types... >::type type_at
Determines the type at position x_index within parameter pack x_types.
Definition: typeat.hh:34
_stream< type_at< x_index, x_out_types... > > & out_stream()
Definition: producer.hh:41
_buffer< type_at< x_index, x_out_types... > > & out_buffer()
Definition: producer.hh:47
virtual ~producer()
Definition: producer.cc:11
Template prototype.
Definition: typechain.hh:45
The prototype class that gets replaced by a type.
Definition: typechain.hh:36
output * out(const std::string &p_label)
Definition: node.cc:52
std::integral_constant< int, x_value > type_int
Wraps integral constant x_value in a type; value is available as type_int::value. ...
Definition: typeint.hh:9
The prototype class that gets replaced by a type index (or rather the struct that wraps a type&#39;s inde...
Definition: typechain.hh:40