Class FileBlockProducer

Inheritance Relationships

Base Type

Class Documentation

class FileBlockProducer : public ska::pst::common::BlockProducer

Loads blocks of data from file.

Currently maps the entire file into memory as a single block.

Public Functions

FileBlockProducer(const std::string &file_path)

Construct a new FileBlockProducer object.

Parameters

file_path – path to the DADA file to open for reading

~FileBlockProducer()

Destroy a FileBlockProducer object.

virtual const ska::pst::common::AsciiHeader &get_header() const

Get the AsciiHeader that describes the DADA file contents.

Returns

const ska::pst::common::AsciiHeader& header of the DADA file

virtual BlockProducer::Block next_block()

Get the next block of data.

When first called, returns a pair containing

  • the base address of the start of data in the memory-mapped DADA file

  • the size of the file in bytes (minus the size of the header) If called again, this function returns (nullptr, 0)

Protected Attributes

std::unique_ptr<ska::pst::common::FileReader> reader

the DADA file reader

BlockProducer::Block block_info

the details of the entire block

BlockProducer::Block next_block_info

the details of the next block