NanoSlice.cc
Go to the documentation of this file.
2 
3 dune::NanoSlice::NanoSlice(uint8_t* address) : buffer_(address) { }
4 
6 {
7  return header_()->nanoslice_size;
8 }
9 
11 {
12  return header_()->channel_number;
13 }
14 
16 {
17  return header_()->sample_count;
18 }
19 
20 bool dune::NanoSlice::sampleValue(uint32_t index, uint16_t& value) const
21 {
22  if (index >= sampleCount()) {return false;}
23  value = data_()[index];
24  return true;
25 }
26 
28 {
29  return reinterpret_cast<Header const*>(buffer_);
30 }
31 
32 uint16_t const* dune::NanoSlice::data_() const
33 {
34  return reinterpret_cast<uint16_t const*>(buffer_ + sizeof(Header));
35 }
NanoSlice(uint8_t *address)
Definition: NanoSlice.cc:3
uint16_t const * data_() const
Definition: NanoSlice.cc:32
bool sampleValue(uint32_t index, uint16_t &value) const
Definition: NanoSlice.cc:20
Header::sample_count_t sampleCount() const
Definition: NanoSlice.cc:15
uint8_t * buffer_
Definition: NanoSlice.hh:56
Header::nanoslice_size_t size() const
Definition: NanoSlice.cc:5
Header::channel_number_t channelNumber() const
Definition: NanoSlice.cc:10
Header const * header_() const
Definition: NanoSlice.cc:27