Project
Loading...
Searching...
No Matches
o2::phos::RawReaderMemory Class Reference

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::RDHAnygetRawHeader () const
 access to the raw header of the current page
 
const RawPayloadgetPayload () 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)
 

Detailed Description

Reader for raw data produced by the Readout application in in-memory format.

Author
Dmitri Peresunko after Markus Fasel
Since
Sept. 25, 2020

Definition at line 36 of file RawReaderMemory.h.

Constructor & Destructor Documentation

◆ RawReaderMemory()

RawReaderMemory::RawReaderMemory ( const gsl::span< const char rawmemory)

Constructor.

Definition at line 23 of file RawReaderMemory.cxx.

◆ ~RawReaderMemory()

o2::phos::RawReaderMemory::~RawReaderMemory ( )
default

Destructor.

Member Function Documentation

◆ decodeRawHeader()

o2::header::RDHAny RawReaderMemory::decodeRawHeader ( const void headerwords)
protected

Definition at line 34 of file RawReaderMemory.cxx.

◆ getFileSize()

int o2::phos::RawReaderMemory::getFileSize ( ) const
inlinenoexcept

get the size of the file in bytes

Returns
size of the file in byte

Definition at line 84 of file RawReaderMemory.h.

◆ getNumberOfPages()

int o2::phos::RawReaderMemory::getNumberOfPages ( ) const
inlinenoexcept

get the number of pages in the file

Returns
number of pages in the file

Definition at line 88 of file RawReaderMemory.h.

◆ getPayload()

const RawPayload & o2::phos::RawReaderMemory::getPayload ( ) const
inline

access to the full raw payload (single or multiple DMA pages)

Returns
Raw Payload of the data until the stop bit is received.

Definition at line 76 of file RawReaderMemory.h.

◆ getPayloadSize()

int o2::phos::RawReaderMemory::getPayloadSize ( ) const
inline

Return size of the payload.

Returns
size of the payload

Definition at line 80 of file RawReaderMemory.h.

◆ getRawHeader()

const o2::header::RDHAny & RawReaderMemory::getRawHeader ( ) const

access to the raw header of the current page

Returns
Raw header of the current page
Exceptions
RawDecodingErrorwith HEADER_INVALID if the header was not decoded

Definition at line 147 of file RawReaderMemory.cxx.

◆ hasNext()

bool o2::phos::RawReaderMemory::hasNext ( ) const
inline

check if more pages are available in the raw file

Returns
true if there is a next page

Definition at line 92 of file RawReaderMemory.h.

◆ init()

void RawReaderMemory::init ( )
protected

Initialize the raw stream.

Rewind stream to the first entry

Definition at line 44 of file RawReaderMemory.cxx.

◆ next()

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.

◆ nextPage()

void RawReaderMemory::nextPage ( bool  resetPayload = true)

Read the next page from the stream (single DMA page)

Parameters
resetPayloadIf true the raw payload is reset
Exceptions
Errorif 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.

◆ setRawMemory()

void RawReaderMemory::setRawMemory ( const gsl::span< const char rawmemory)

set new raw memory chunk

Parameters
rawmemoryNew raw memory chunk

Definition at line 28 of file RawReaderMemory.cxx.


The documentation for this class was generated from the following files: