Project
Loading...
Searching...
No Matches
o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS > Class Template Reference

#include <RawParser.h>

Public Types

using buffer_type = unsigned char
 
using header_type = HeaderType
 
using self_type = ConcreteRawParser
 

Public Member Functions

 ConcreteRawParser ()=delete
 
template<typename T >
 ConcreteRawParser (T const *buffer, size_t size)
 
 ConcreteRawParser (ConcreteRawParser const &other)=default
 
header_type const & header () const
 Get header at current position.
 
size_t size () const
 Get size of payload at current position.
 
size_t sizeTotal () const
 Get size of header + payload at current position.
 
buffer_type const * data () const
 Get pointer to payload data at current position.
 
buffer_type const * raw () const
 Get pointer to raw buffer at current position.
 
size_t offset () const
 Get offset of payload in the raw buffer at current position.
 
bool checkPageInBuffer () const
 
template<typename Processor >
void parse (Processor &&processor)
 
bool next ()
 Move to next page start.
 
bool reset ()
 Reset the parser, set position to beginning of buffer.
 
void advance (int step)
 
size_t getNErrors () const
 
template<typename T = self_type>
bool operator== (T const &other) const
 
void format (std::ostream &os, FormatSpec choice=FormatSpec::Entry, const char *delimiter="\n") const
 

Static Public Attributes

static constexpr size_t max_size = MAX_SIZE
 

Detailed Description

template<typename HeaderType, size_t MAX_SIZE, bool BOUNDS_CHECKS>
class o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >

Raw parser implementation for a particular version of RAWDataHeader. Parses a contiguous sequence of raw pages in a raw buffer.

Template parameters: HeaderType the raw data header type MAX_SIZE maximum page size BOUNDS_CHECKS check buffer bounds while navigating RDHs

We expect the actual page size to be variable up to the maximum size, actual size given by fields of the RAWDataHeader.

Definition at line 108 of file RawParser.h.

Member Typedef Documentation

◆ buffer_type

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
using o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::buffer_type = unsigned char

Definition at line 111 of file RawParser.h.

◆ header_type

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
using o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::header_type = HeaderType

Definition at line 112 of file RawParser.h.

◆ self_type

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
using o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::self_type = ConcreteRawParser

Definition at line 113 of file RawParser.h.

Constructor & Destructor Documentation

◆ ConcreteRawParser() [1/3]

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::ConcreteRawParser ( )
delete

◆ ConcreteRawParser() [2/3]

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
template<typename T >
o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::ConcreteRawParser ( T const *  buffer,
size_t  size 
)
inline

Constructor Raw buffer is provided by pointer and size, read-only access

Definition at line 121 of file RawParser.h.

◆ ConcreteRawParser() [3/3]

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::ConcreteRawParser ( ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS > const &  other)
default

copy constructor, we allow for copies of the parser because acces to the underlying buffer is read-only, the copy starts at the same state mainly used for the iterator

Member Function Documentation

◆ advance()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
void o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::advance ( int  step)
inline

Advance position by number of steps Positions are given by RAWDataHeaders, either at fixed page size or variable length.

Parameters
stepStep number to advance, if -1 position is set beyond the buffer (end iterator)

Definition at line 312 of file RawParser.h.

◆ checkPageInBuffer()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
bool o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::checkPageInBuffer ( ) const
inline

Definition at line 199 of file RawParser.h.

◆ data()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
buffer_type const * o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::data ( ) const
inline

Get pointer to payload data at current position.

Definition at line 170 of file RawParser.h.

◆ format()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
void o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::format ( std::ostream &  os,
FormatSpec  choice = FormatSpec::Entry,
const char delimiter = "\n" 
) const
inline

Definition at line 340 of file RawParser.h.

◆ getNErrors()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
size_t o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::getNErrors ( ) const
inline

Definition at line 323 of file RawParser.h.

◆ header()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
header_type const & o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::header ( ) const
inline

Get header at current position.

Definition at line 138 of file RawParser.h.

◆ next()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
bool o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::next ( )
inline

Move to next page start.

Definition at line 240 of file RawParser.h.

◆ offset()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
size_t o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::offset ( ) const
inline

Get offset of payload in the raw buffer at current position.

Definition at line 190 of file RawParser.h.

◆ operator==()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
template<typename T = self_type>
bool o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::operator== ( T const &  other) const
inline

Comparison: instances are equal if they serve the same buffer and are in the same state, i.e. at same position

Definition at line 331 of file RawParser.h.

◆ parse()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
template<typename Processor >
void o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::parse ( Processor &&  processor)
inline

Parse the complete buffer For each page, the processor function is called with the payload buffer and size, processor has signature void(unsigned char const*, size_t)

Definition at line 217 of file RawParser.h.

◆ raw()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
buffer_type const * o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::raw ( ) const
inline

Get pointer to raw buffer at current position.

Definition at line 181 of file RawParser.h.

◆ reset()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
bool o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::reset ( )
inline

Reset the parser, set position to beginning of buffer.

Definition at line 302 of file RawParser.h.

◆ size()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
size_t o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::size ( ) const
inline

Get size of payload at current position.

Definition at line 144 of file RawParser.h.

◆ sizeTotal()

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
size_t o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::sizeTotal ( ) const
inline

Get size of header + payload at current position.

Definition at line 157 of file RawParser.h.

Member Data Documentation

◆ max_size

template<typename HeaderType , size_t MAX_SIZE, bool BOUNDS_CHECKS>
constexpr size_t o2::framework::raw_parser::ConcreteRawParser< HeaderType, MAX_SIZE, BOUNDS_CHECKS >::max_size = MAX_SIZE
staticconstexpr

Definition at line 114 of file RawParser.h.


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