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

#include <RawParser.h>

Classes

class  Iterator
 
struct  RawDataHeaderInfo
 

Public Types

using buffer_type = unsigned char
 
using self_type = RawParser< MAX_SIZE, BOUNDS_CHECKS >
 
using const_iterator = Iterator< RawDataHeaderInfo const, raw_parser::ConcreteParserVariants< MAX_SIZE, BOUNDS_CHECKS > >
 

Public Member Functions

 RawParser ()=delete
 
template<typename T >
 RawParser (T const *buffer, size_t size)
 Constructor, raw buffer provided by pointer and size.
 
template<typename Processor >
void parse (Processor &&processor)
 Parse complete raw buffer and call processor on payload data for each page.
 
bool reset ()
 Reset parser and set position to beginning of buffer.
 
const_iterator begin () const
 
const_iterator end () const
 
size_t getNErrors () const
 

Static Public Member Functions

static void setCheckIncompleteHBF (bool v)
 

Static Public Attributes

static size_t const max_size = MAX_SIZE
 

Friends

std::ostream & operator<< (std::ostream &os, self_type const &parser)
 

Detailed Description

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
class o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >

the O2 raw data O2 raw data is organized in pages of a fixed size, each page starts with the RAWDataHeader The page size may actually be smaller than the maximum size, depending on the header fields.

The parser class works on a contiguous sequence of raw pages in a raw buffer. Multiple versions of RAWDataHeader are supported transparently and selected depending on the version field of the header.

Usage:
// option 1: parse method
RawParser parser(buffer, size);
auto processor = [&count](auto data, size_t size) {
  std::cout << "Processing block of size " << size << std::endl;
};
parser.parse(processor);

// option 2: iterator
RawParser parser(buffer, size);
for (auto it = parser.begin(), end = parser.end(); it != end; ++it, ++count) {
  std::cout << "Iterating block of size " << it.size() << std::endl;
  auto dataptr = it.data();
}
TODO:
  • iterators are not independent at the moment and this can cause conflicts, this must be improved

Definition at line 465 of file RawParser.h.

Member Typedef Documentation

◆ buffer_type

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
using o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::buffer_type = unsigned char

Definition at line 468 of file RawParser.h.

◆ const_iterator

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
using o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::const_iterator = Iterator<RawDataHeaderInfo const, raw_parser::ConcreteParserVariants<MAX_SIZE, BOUNDS_CHECKS> >

Definition at line 616 of file RawParser.h.

◆ self_type

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
using o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::self_type = RawParser<MAX_SIZE, BOUNDS_CHECKS>

Definition at line 470 of file RawParser.h.

Constructor & Destructor Documentation

◆ RawParser() [1/2]

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::RawParser ( )
delete

◆ RawParser() [2/2]

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
template<typename T >
o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::RawParser ( T const *  buffer,
size_t  size 
)
inline

Constructor, raw buffer provided by pointer and size.

Definition at line 476 of file RawParser.h.

Member Function Documentation

◆ begin()

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
const_iterator o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::begin ( ) const
inline

Definition at line 618 of file RawParser.h.

◆ end()

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
const_iterator o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::end ( ) const
inline

Definition at line 623 of file RawParser.h.

◆ getNErrors()

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
size_t o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::getNErrors ( ) const
inline

Definition at line 642 of file RawParser.h.

◆ parse()

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
template<typename Processor >
void o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::parse ( Processor &&  processor)
inline

Parse complete raw buffer and call processor on payload data for each page.

Definition at line 485 of file RawParser.h.

◆ reset()

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
bool o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::reset ( )
inline

Reset parser and set position to beginning of buffer.

Definition at line 495 of file RawParser.h.

◆ setCheckIncompleteHBF()

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
static void o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::setCheckIncompleteHBF ( bool  v)
inlinestatic

Definition at line 647 of file RawParser.h.

Friends And Related Symbol Documentation

◆ operator<<

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
std::ostream & operator<< ( std::ostream &  os,
self_type const &  parser 
)
friend

Definition at line 628 of file RawParser.h.

Member Data Documentation

◆ max_size

template<size_t MAX_SIZE = 8192, bool BOUNDS_CHECKS = true>
size_t const o2::framework::RawParser< MAX_SIZE, BOUNDS_CHECKS >::max_size = MAX_SIZE
static

Definition at line 469 of file RawParser.h.


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