Class DataBlockRead
Defined in File DataBlockRead.h
Inheritance Relationships
Base Type
public ska::pst::smrb::DataBlockAccessor
(Class DataBlockAccessor)
Class Documentation
-
class DataBlockRead : public ska::pst::smrb::DataBlockAccessor
Object Oriented interface to read to a PSRDADA Shared Memory Ring Buffer (SMRB).
Public Functions
-
explicit DataBlockRead(const std::string &key)
Construct a new Data Block Read object for the SMRB identified by the key.
- Parameters
key – 4 character hexidecimal key that identifies the SMRB in shared memory.
-
~DataBlockRead()
Destroy the Data Block Read object. Closes the access to the SMRB if required.
-
virtual void open() override
Open the SMRB for reading.
-
virtual void lock() override
Lock read access to the SMRB.
-
virtual void close() override
Close the connection to the SMRB.
-
virtual void unlock() override
Unlock read access to the SMRB.
-
void read_config()
Read the scan configuration from the header_block.
-
void read_header()
Read the complete header from the header_block.
-
ssize_t read_data(char *buffer, size_t nbytes)
Read requested nbytes from the datablock into the provided buffer.
- Parameters
buffer –
nbytes –
- Returns
ssize_t
-
virtual char *open_block() override
Open a data_block buffer for DMA.
- Returns
void* pointer to the opened data_block buffer
-
virtual ssize_t close_block(uint64_t bytes) override
Close an opened data_block buffer specifying the number of bytes read.
- Parameters
bytes – number of bytes read to the opened data_block buffer
- Returns
ssize_t number of bytes read
-
ssize_t update_block(uint64_t bytes)
Update the number of bytes read to the opened data_block buffer.
- Parameters
bytes – number of bytes read
- Returns
ssize_t number of bytes read
-
void zero_next_block()
zero the buffer in the data_block after the currently opened buffer
-
bool check_eod()
Check if the End-Of-Data flag on the data block.
- Returns
true if the End-Of-Data flag has been raised
-
explicit DataBlockRead(const std::string &key)