Psyllid  v1.12.4
Project 8 Data Acquisisition Software
egg3_reader.hh
Go to the documentation of this file.
1 /*
2  * egg3_reader.hh
3  *
4  * Created on: Dec 14, 2017
5  * Author: laroque
6  */
7 
8 #ifndef PSYLLID_EGG3_READER_HH_
9 #define PSYLLID_EGG3_READER_HH_
10 
11 #include "producer.hh"
12 
13 #include "control_access.hh"
14 #include "memory_block.hh"
15 #include "node_builder.hh"
16 
17 namespace monarch3
18 {
19  class Monarch3;
20  class M3Stream;
21  class M3Record;
22 }
23 
24 namespace psyllid
25 {
47  // forward declarations
48  class time_data;
49 
50  // egg3_reader
51  class egg3_reader : public midge::_producer< midge::type_list<time_data> >, public control_access
52  {
53  public:
54  egg3_reader();
55  virtual ~egg3_reader();
56 
57  public:
58  mv_accessible( const monarch3::Monarch3*, egg );
59  mv_accessible( std::string, egg_path );
60  mv_accessible( uint64_t, read_n_records );
61  mv_accessible( bool, repeat_egg );
62  mv_accessible( uint64_t, length );
63  mv_accessible( bool, start_paused );
64 
65  private:
66  bool f_paused;
67  uint32_t f_record_length;
68  uint64_t f_pkt_id_offset;
69 
70  public:
71  virtual void initialize();
72  virtual void execute( midge::diptera* a_midge = nullptr );
73  virtual void finalize();
74 
75  private:
76  bool read_slice( time_data* t_data, const monarch3::M3Stream* t_stream, const monarch3::M3Record* t_record);
77  void cleanup_file();
78 
79  };
80 
81  class egg3_reader_binding : public _node_binding< egg3_reader, egg3_reader_binding >
82  {
83  public:
85  virtual ~egg3_reader_binding();
86  private:
87  virtual void do_apply_config( egg3_reader* a_node, const scarab::param_node& a_config ) const;
88  virtual void do_dump_config( const egg3_reader* a_node, scarab::param_node& a_config ) const;
89  };
90 
91 } /* namespace psyllid */
92 
93 #endif /* PSYLLID_EGG3_READER_HH_ */
uint32_t f_record_length
Definition: egg3_reader.hh:67
Gives other classes access to daq_control.
A producer to read time-domain slices from an egg file and place them in time data buffers...
Definition: egg3_reader.hh:51
uint64_t f_pkt_id_offset
Definition: egg3_reader.hh:68