Midge  v3.9.2
Data Processing Framework
test_producer.cc
Go to the documentation of this file.
1 /*
2  * test_producer.cc
3  *
4  * Created on: Dec 17, 2018
5  * Author: N.S. Oblath
6  */
7 
8 #include <iostream>
9 
10 #include "producer.hh"
11 
12 using std::cout;
13 using std::endl;
14 
15 namespace midge
16 {
17  namespace test
18  {
19  class int_data
20  {
21  public:
22  int_data() : f_value( 5 ) {}
23  ~int_data() {}
24 
25  void set_data( int value ) {f_value = value;}
26  int get_data() const {return f_value;}
27 
28  private:
29  int f_value;
30  };
31 
32  class int_producer : public midge::_producer< type_list< int_data > >
33  {
34  public:
35  int_producer() : f_length( 10 ) {}
36  virtual ~int_producer() {}
37 
38  public:
39  void set_length( unsigned length ) {f_length = length;}
40  unsigned get_length() const {return f_length;}
41 
42  private:
43  unsigned f_length;
44 
45  public:
46  virtual void initialize() {}
47  virtual void execute( midge::diptera* a_midge = nullptr ) {}
48  virtual void finalize() {}
49 
50  };
51 
52  }
53 }
54 
55 using namespace midge;
56 using namespace midge::test;
57 
58 int main()
59 {
60  int_producer prod;
61 
62  return 0;
63 }
64 
65 
66 
virtual void execute(midge::diptera *a_midge=nullptr)
int main()
Definition: _buffer.hh:11
void set_data(int value)
test
Definition: test_buffer.cc:14
unsigned get_length() const
void set_length(unsigned length)