Midge  v3.9.2
Data Processing Framework
consumer.hh
Go to the documentation of this file.
1 #ifndef _midge_consumer_hh_
2 #define _midge_consumer_hh_
3 
4 #include "_in.hh"
5 #include "node.hh"
6 #include "typeat.hh"
7 #include "typechain.hh"
8 
9 namespace midge
10 {
11 
12  class consumer :
13  virtual public node
14  {
15  protected:
16  consumer();
17 
18  public:
19  virtual ~consumer();
20  };
21 
22  template< class x_in_list >
23  class _consumer;
24 
25  template< template<class...> class x_in_list, class... x_in_types >
26  class _consumer< x_in_list<x_in_types...> > :
27  public consumer,
28  public type_start_chain< _in< _type, _index >, x_in_types... >
29  {
30  public:
31  using node::in;
32 
33  public:
34  _consumer();
35  virtual ~_consumer();
36 
37  protected:
38  template< int x_index >
39  _stream< type_at< x_index, x_in_types... > >& in_stream()
40  {
41  return this->_in< type_at< x_index, x_in_types... >, type_int< x_index > >::get_stream();
42  }
43  };
44 
45  template< template<class...> class x_in_list, class... x_in_types >
46  _consumer< x_in_list<x_in_types...> >::_consumer() :
47  consumer(),
48  type_start_chain< _in< _type, _index >, x_in_types... >()
49  {
50  }
51 
52  template< template<class...> class x_in_list, class... x_in_types >
53  _consumer< x_in_list<x_in_types...> >::~_consumer()
54  {
55  }
56 
57 }
58 
59 #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
input * in(const std::string &p_label)
Definition: node.cc:42
_stream< type_at< x_index, x_in_types... > > & in_stream()
Definition: consumer.hh:39
Template prototype.
Definition: typechain.hh:45
virtual ~consumer()
Definition: consumer.cc:11
The prototype class that gets replaced by a type.
Definition: typechain.hh:36
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