Project
Loading...
Searching...
No Matches
o2::emcal::RawBuffer Class Reference

Buffer for EMCAL raw pages. More...

#include <RawBuffer.h>

Public Member Functions

 RawBuffer ()=default
 
 ~RawBuffer ()=default
 
void reset ()
 
void flush ()
 Flush the buffer Does not overwrite the word buffer but just resets the counter and iterator.
 
void readFromStream (std::istream &in, uint32_t payloadsize)
 Read page from stream.
 
void readFromMemoryBuffer (const gsl::span< const char > rawmemory)
 Read page from raw memory buffer.
 
int getNDataWords () const
 Get the number of data words read for the superpage.
 
uint32_t getNextDataWord ()
 Get the next data word in the superpage.
 
uint32_t getWord (int index) const
 Get the data word at a given index.
 
const gsl::span< const uint32_t > getDataWords () const
 Get all data words from the raw buffer.
 
bool hasNext () const
 Check whether the next data word exists.
 

Detailed Description

Buffer for EMCAL raw pages.

Author
Markus Fasel marku.nosp@m.s.fa.nosp@m.sel@c.nosp@m.ern..nosp@m.ch, Oak Ridge National Laboratory
Since
Aug. 9, 2019

Definition at line 29 of file RawBuffer.h.

Constructor & Destructor Documentation

◆ RawBuffer()

o2::emcal::RawBuffer::RawBuffer ( )
default

◆ ~RawBuffer()

o2::emcal::RawBuffer::~RawBuffer ( )
default

Member Function Documentation

◆ flush()

void RawBuffer::flush ( )

Flush the buffer Does not overwrite the word buffer but just resets the counter and iterator.

Definition at line 19 of file RawBuffer.cxx.

◆ getDataWords()

const gsl::span< const uint32_t > o2::emcal::RawBuffer::getDataWords ( ) const
inline

Get all data words from the raw buffer.

Returns
Span with data words in the buffer (removing trailing null entries)

Definition at line 72 of file RawBuffer.h.

◆ getNDataWords()

int o2::emcal::RawBuffer::getNDataWords ( ) const
inline

Get the number of data words read for the superpage.

Returns
Number of data words in the superpage

Definition at line 57 of file RawBuffer.h.

◆ getNextDataWord()

uint32_t RawBuffer::getNextDataWord ( )

Get the next data word in the superpage.

Returns
next data word in the superpage
Exceptions
std::runtime_errorif there exists no next data word

Definition at line 71 of file RawBuffer.cxx.

◆ getWord()

uint32_t RawBuffer::getWord ( int  index) const

Get the data word at a given index.

Parameters
indexindex of the word in the buffer
Returns
word at requested index
Exceptions
std::runtime_errorif the index is out-of-range

Definition at line 63 of file RawBuffer.cxx.

◆ hasNext()

bool o2::emcal::RawBuffer::hasNext ( ) const
inline

Check whether the next data word exists.

Returns
True if more data words exist, false otherwise Check is done starting from the current position of the iterator

Definition at line 78 of file RawBuffer.h.

◆ readFromMemoryBuffer()

void RawBuffer::readFromMemoryBuffer ( const gsl::span< const char rawmemory)

Read page from raw memory buffer.

Parameters
rawmemoryRaw memory buffer (as char words) with size of the payload from the raw data header Converts the char word raw memory buffer of a pages into into the 32 bit word buffer

Definition at line 46 of file RawBuffer.cxx.

◆ readFromStream()

void RawBuffer::readFromStream ( std::istream &  in,
uint32_t  payloadsize 
)

Read page from stream.

Parameters
inInput file stream
payloadsizeNumber of char words in payload Read a whole superpage from the raw stream and convert the bitwise representation directly into 32 bit words

Definition at line 26 of file RawBuffer.cxx.

◆ reset()

void o2::emcal::RawBuffer::reset ( )
inline

Definition at line 35 of file RawBuffer.h.


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