PennMicroSliceWriter.hh
Go to the documentation of this file.
1 #ifndef dune_artdaq_Overlays_PennMicroSliceWriter_hh
2 #define dune_artdaq_Overlays_PennMicroSliceWriter_hh
3 
5 
6 namespace dune {
7  class PennMicroSliceWriter;
8 }
9 
11 
12 public:
13 
14  // This constructor creates an empty PennMicroSlice which can be filled
15  // with the appropriate data
16  PennMicroSliceWriter(uint8_t* address, uint32_t max_size_bytes);//, uint8_t sequence_id);
17 
18  // void setSequenceId(uint8_t);
19 
20  // Adds the specified data sample PennMicroSlice. Returns true
21  // if it was successfully added, false if not (for example, if the
22  // additional sample would overflow the maximum size of the
23  // PennMicroSlice).
24  // bool addSample(uint16_t value);
25  bool addData(uint16_t* data, uint16_t data_size);
26 
27  // Finalizes the PennMicroSlice. This takes care of updating the
28  // PennMicroSlice so that all internal pointers and data are consistent
29  // with the data that has been added. No more samples can be added
30  // once the PennMicroSlice has been finalized.
31  // This method returns the number of bytes that were reclaimed
32  // when the maximum size for this PennMicroSlice was reduced to match
33  // its actual current size.
34  int32_t finalize();
35 
36 protected:
37 
38  // returns a pointer to the header
39  Header * header_();
40 
41  // returns a pointer to the first sample value
42  uint16_t * data_();
43 
44  uint32_t max_size_bytes_;
45 };
46 
47 #endif /* dune_artdaq_Overlays_PennMicroSliceWriter_hh */
bool addData(uint16_t *data, uint16_t data_size)
PennMicroSliceWriter(uint8_t *address, uint32_t max_size_bytes)
Header of ethernet packet.