![]() |
Project
|
Reader for raw data produced by the Readout application in in-memory format. More...
#include <RawReaderMemory.h>
Public Member Functions | |
RawReaderMemory (const gsl::span< const char > rawmemory) | |
Constructor. | |
~RawReaderMemory ()=default | |
Destructor. | |
void | setRawMemory (const gsl::span< const char > rawmemory) |
set new raw memory chunk | |
void | next () |
Read next payload from the stream. | |
void | nextPage (bool resetPayload=true) |
Read the next page from the stream (single DMA page) | |
const o2::header::RDHAny & | getRawHeader () const |
access to the raw header of the current page | |
const RawPayload & | getPayload () const |
access to the full raw payload (single or multiple DMA pages) | |
int | getPayloadSize () const |
Return size of the payload. | |
int | getFileSize () const noexcept |
get the size of the file in bytes | |
int | getNumberOfPages () const noexcept |
get the number of pages in the file | |
bool | hasNext () const |
check if more pages are available in the raw file | |
Protected Member Functions | |
void | init () |
Initialize the raw stream. | |
o2::header::RDHAny | decodeRawHeader (const void *headerwords) |
Reader for raw data produced by the Readout application in in-memory format.
Definition at line 36 of file RawReaderMemory.h.
RawReaderMemory::RawReaderMemory | ( | const gsl::span< const char > | rawmemory | ) |
Constructor.
Definition at line 23 of file RawReaderMemory.cxx.
|
default |
Destructor.
|
protected |
Definition at line 34 of file RawReaderMemory.cxx.
|
inlinenoexcept |
get the size of the file in bytes
Definition at line 84 of file RawReaderMemory.h.
|
inlinenoexcept |
get the number of pages in the file
Definition at line 88 of file RawReaderMemory.h.
|
inline |
access to the full raw payload (single or multiple DMA pages)
Definition at line 76 of file RawReaderMemory.h.
|
inline |
Return size of the payload.
Definition at line 80 of file RawReaderMemory.h.
const o2::header::RDHAny & RawReaderMemory::getRawHeader | ( | ) | const |
access to the raw header of the current page
RawDecodingError | with HEADER_INVALID if the header was not decoded |
Definition at line 147 of file RawReaderMemory.cxx.
|
inline |
check if more pages are available in the raw file
Definition at line 92 of file RawReaderMemory.h.
|
protected |
Initialize the raw stream.
Rewind stream to the first entry
Definition at line 44 of file RawReaderMemory.cxx.
void RawReaderMemory::next | ( | ) |
Read next payload from the stream.
Read the next pages until the stop bit is found.
Definition at line 53 of file RawReaderMemory.cxx.
void RawReaderMemory::nextPage | ( | bool | resetPayload = true | ) |
Read the next page from the stream (single DMA page)
resetPayload | If true the raw payload is reset |
Error | if the page cannot be read or header or payload cannot be deocded |
Function reading a single DMA page from the stream. It is called inside the next() function for reading payload from multiple DMA pages. As the function cannot handle payload from multiple pages it should not be called directly by the user.
Assume fixed 8 kB page size
Definition at line 108 of file RawReaderMemory.cxx.
set new raw memory chunk
rawmemory | New raw memory chunk |
Definition at line 28 of file RawReaderMemory.cxx.