Class SmrbBlockProducer

Inheritance Relationships

Base Type

  • public ska::pst::common::BlockProducer

Class Documentation

class SmrbBlockProducer : public ska::pst::common::BlockProducer

Loads blocks of data from file.

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

Public Functions

SmrbBlockProducer(const std::string &key)

Construct a new SmrbBlockProducer object.

Parameters

key – 4-character hexidecimal string for a PSRDADA shared memory ring buffer

~SmrbBlockProducer()

Destroy a SmrbBlockProducer object.

void connect(int timeout)

Connect to the shared memory ring buffer and read the beam configuration.

Call this method during configure_scan in an application

void open()

Open the shared memory ring buffer for viewing and read the scan configuration.

Call this method at the start of perform_scan in an application

void close()

Close the shared memory ring buffer.

void disconnect()

Disconnect from the shared memory ring buffer.

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

Get the AsciiHeader that is parsed from the header block.

Returns

const ska::pst::common::AsciiHeader& header parsed from the header block

ska::pst::common::BlockProducer::Block next_block() override

Get the next block of data.

At the end of the data stream, the base address is set to nullptr and the size is set to zero

Returns

ska::pst::common::BlockProducer object representing the base address and size, in bytes, of a block of data

size_t get_current_buffer_index() const

Get the index of the current buffer of the SMRB data block.

void seek_to_buffer_index(size_t buffer_index)

Go to the specified buffer of the SMRB data block.

Parameters

buffer_index – ring buffer index in the data block

inline size_t get_obs_offset() const

Get the obs_offset of the current_block, from the start of the scan, in bytes.

Returns

size_t offset from the start of the scan in bytes.

Protected Attributes

std::unique_ptr<ska::pst::smrb::DataBlockView> viewer

the shared memory ring buffer viewer

ska::pst::common::AsciiHeader header

the header parsed from the header block of the shared memory ring buffer

ska::pst::common::BlockProducer::Block current_block

the current block

bool seek_to_end = {true}

when true, seek to the end of the ring buffer at start of next_block