Midge  v3.9.2
Data Processing Framework
_out.hh
Go to the documentation of this file.
1 #ifndef _midge_out_hh_
2 #define _midge_out_hh_
3 
4 #include "_buffer.hh"
5 #include "_output.hh"
6 #include "_stream.hh"
7 #include "node.hh"
8 
9 namespace midge
10 {
11 
12  template< class x_type, class x_index >
13  class _out :
14  virtual public node
15  {
16  public:
17  _out() :
18  f_buffer( new _buffer< x_type >( this ) )
19  {
20  std::string t_name( "out_"+std::to_string(x_index::value) );
21  node::out( new _output< _out< x_type, x_index >, x_type >( this, &_out< x_type, x_index >::out ), t_name );
22  f_buffer->set_write_stream_name( t_name );
23  }
24  virtual ~_out()
25  {
26  delete f_buffer;
27  }
28 
29  public:
31  {
32  return f_buffer->read();
33  }
34 
35  protected:
37  {
38  return *(f_buffer);
39  }
41  {
42  return *(f_buffer->write());
43  }
44 
45  private:
47  };
48 }
49 
50 #endif
_buffer< x_type > * f_buffer
Definition: _out.hh:46
_stream< x_type > * out()
Definition: _out.hh:30
Definition: _buffer.hh:11
_buffer< x_type > & get_buffer()
Definition: _out.hh:36
virtual ~_out()
Definition: _out.hh:24
output * out(const std::string &p_label)
Definition: node.cc:52
_out()
Definition: _out.hh:17
_stream< x_type > & get_stream()
Definition: _out.hh:40