BlockSize.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2023 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Kernel/Classes/dsp/BlockSize.h
10 
11 #ifndef __dsp_BlockSize_h
12 #define __dsp_BlockSize_h
13 
14 #include "dsp/Observation.h"
15 
16 namespace dsp {
17 
19  class BlockSize : public dsp::Observation::NbyteNsamplePolicy
20  {
21  public:
22 
24  BlockSize* clone () const override;
25 
27  uint64_t get_nbytes (uint64_t nsamples) const override;
28 
30  uint64_t get_nsamples (uint64_t nbytes) const override;
31 
33  uint64_t get_block_data_bytes() const { return block_data_bytes; }
34 
36  void set_block_data_bytes(uint64_t bytes) { block_data_bytes = bytes; }
37 
39  uint64_t get_block_header_bytes() const { return block_header_bytes; }
40 
42  void set_block_header_bytes(uint64_t bytes) { block_header_bytes = bytes; }
43 
45  uint64_t get_block_tailer_bytes() const { return block_tailer_bytes; }
46 
48  void set_block_tailer_bytes(uint64_t bytes) { block_tailer_bytes = bytes; }
49 
52 
54  void load (const char* header);
55 
56  protected:
57 
59  uint64_t block_data_bytes {0};
60 
62  uint64_t block_header_bytes {0};
63 
65  uint64_t block_tailer_bytes {0};
66  };
67 }
68 
69 #endif // !defined(__BlockSize_h)
70 
71 
uint64_t get_block_tailer_bytes() const
Get the number of bytes in tailer of each block.
Definition: BlockSize.h:55
uint64_t get_block_bytes() const
Get the total number of bytes in each block (header + data + tailer)
Definition: BlockSize.h:61
void set_block_tailer_bytes(uint64_t bytes)
Set the number of bytes in tailer of each block.
Definition: BlockSize.h:58
void set_block_data_bytes(uint64_t bytes)
Set the number of data bytes per block.
Definition: BlockSize.h:46
uint64_t block_data_bytes
Number of bytes of data in each block.
Definition: BlockSize.h:69
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
BlockSize * clone() const override
Return a new instance of self.
Definition: BlockSize.C:51
uint64_t get_block_data_bytes() const
Get the number of data bytes per block.
Definition: BlockSize.h:43
void set_block_header_bytes(uint64_t bytes)
Set the number of bytes in header of each block.
Definition: BlockSize.h:52
uint64_t get_nbytes(uint64_t nsamples) const override
Return the size in bytes of nsamples time samples.
Definition: BlockSize.C:59
uint64_t get_block_header_bytes() const
Get the number of bytes in header of each block.
Definition: BlockSize.h:49
Sizes of header, data, and tailer of data that are divided in blocks / frames / heaps.
Definition: BlockSize.h:24
uint64_t get_nsamples(uint64_t nbytes) const override
Return the number of samples in nbytes bytes.
Definition: BlockSize.C:79
void load(const char *header)
Load BlockSize attributes from a DADA ASCII header.
Definition: BlockSize.C:14
uint64_t block_header_bytes
Number of bytes in header of each block.
Definition: BlockSize.h:72
uint64_t block_tailer_bytes
Number of bytes in tailer of each block.
Definition: BlockSize.h:75

Generated using doxygen 1.8.17