Project
Loading...
Searching...
No Matches
o2::itsmft::PayLoadCont Class Reference

#include <PayLoadCont.h>

Public Member Functions

 PayLoadCont ()=default
 
 PayLoadCont (size_t sz)
 
 ~PayLoadCont ()=default
 
 PayLoadCont (const PayLoadCont &src)
 
PayLoadContoperator= (const PayLoadCont &src)
 
const uint8_t * data () const
 increase the buffer size
 
void expand (size_t sz)
 
bool isEmpty () const
 make buffer empty w/o deallocating it
 
void clear ()
 get unused size
 
size_t getUnusedSize () const
 get filled size
 
size_t getSize () const
 get offset of the current ptr from the head
 
size_t getOffset () const
 booked capacity
 
size_t getCapacity () const
 number of bytes still can accept w/o expanding the buffer
 
size_t getFreeCapacity () const
 make sure buffer may accept at least n bytes
 
void ensureFreeCapacity (size_t n)
 fill n bytes with given symbol w/o checking for the size
 
void fillFast (const uint8_t c, size_t n)
 add n bytes to the buffer w/o checking for the size
 
void addFast (const uint8_t *ptr, size_t n)
 add new byte to the buffer w/o checking for the size
 
void addFast (uint8_t val)
 add new short to the buffer w/o checking for the size
 
void addFast (uint16_t val)
 erase n bytes w/o checking for the underflow
 
void eraseFast (size_t n)
 erase n bytes
 
void erase (size_t n)
 fill n bytes with given symbol
 
void fill (const uint8_t c, size_t n)
 add n bytes to the buffer, expand if needed. no check for overlap
 
void add (const uint8_t *ptr, size_t n)
 add new byte to the buffer
 
void add (uint8_t val)
 add new short to the buffer
 
void add (uint16_t val)
 shrink buffer to requested size, no check on over/under flow
 
void shrinkToSize (size_t sz)
 direct const access to value at a given slot, w/o checking for overflow
 
uint8_t operator[] (size_t i) const
 direct access to value at a given slot, w/o checking for overflow
 
uint8_t & operator[] (size_t i)
 read current character value from buffer w/o stepping forward
 
bool current (uint8_t &v) const
 read character value from buffer
 
bool next (uint8_t &v)
 read short value from buffer
 
bool next (uint16_t &v)
 move current pointer to the head
 
void rewind ()
 move all data between the mPtr and mEnd to the head of the buffer
 
void moveUnusedToHead ()
 move unused data to the head and upload new chunk of data
 
size_t append (std::function< size_t(uint8_t *, size_t)> getNext)
 
uint8_t * getPtr ()
 direct write access
 
void setPtr (uint8_t *ptr)
 
uint8_t * getEnd ()
 
void setEnd (uint8_t *ptr)
 

Static Public Attributes

static constexpr size_t MinCapacity = 16
 allocate buffer
 

Detailed Description

Definition at line 29 of file PayLoadCont.h.

Constructor & Destructor Documentation

◆ PayLoadCont() [1/3]

o2::itsmft::PayLoadCont::PayLoadCont ( )
default

◆ PayLoadCont() [2/3]

o2::itsmft::PayLoadCont::PayLoadCont ( size_t  sz)
inline

Definition at line 39 of file PayLoadCont.h.

◆ ~PayLoadCont()

o2::itsmft::PayLoadCont::~PayLoadCont ( )
default

◆ PayLoadCont() [3/3]

PayLoadCont::PayLoadCont ( const PayLoadCont src)

Definition at line 21 of file PayLoadCont.cxx.

Member Function Documentation

◆ add() [1/3]

void o2::itsmft::PayLoadCont::add ( const uint8_t *  ptr,
size_t  n 
)
inline

add new byte to the buffer

Definition at line 128 of file PayLoadCont.h.

◆ add() [2/3]

void o2::itsmft::PayLoadCont::add ( uint16_t  val)
inline

shrink buffer to requested size, no check on over/under flow

Definition at line 142 of file PayLoadCont.h.

◆ add() [3/3]

void o2::itsmft::PayLoadCont::add ( uint8_t  val)
inline

add new short to the buffer

Definition at line 135 of file PayLoadCont.h.

◆ addFast() [1/3]

void o2::itsmft::PayLoadCont::addFast ( const uint8_t *  ptr,
size_t  n 
)
inline

add new byte to the buffer w/o checking for the size

Definition at line 91 of file PayLoadCont.h.

◆ addFast() [2/3]

void o2::itsmft::PayLoadCont::addFast ( uint16_t  val)
inline

erase n bytes w/o checking for the underflow

Definition at line 101 of file PayLoadCont.h.

◆ addFast() [3/3]

void o2::itsmft::PayLoadCont::addFast ( uint8_t  val)
inline

add new short to the buffer w/o checking for the size

Definition at line 98 of file PayLoadCont.h.

◆ append()

size_t o2::itsmft::PayLoadCont::append ( std::function< size_t(uint8_t *, size_t)>  getNext)
inline

Definition at line 209 of file PayLoadCont.h.

◆ clear()

void o2::itsmft::PayLoadCont::clear ( )
inline

get unused size

Definition at line 54 of file PayLoadCont.h.

◆ current()

bool o2::itsmft::PayLoadCont::current ( uint8_t &  v) const
inline

read character value from buffer

Definition at line 161 of file PayLoadCont.h.

◆ data()

const uint8_t * o2::itsmft::PayLoadCont::data ( ) const
inline

increase the buffer size

Definition at line 46 of file PayLoadCont.h.

◆ ensureFreeCapacity()

void o2::itsmft::PayLoadCont::ensureFreeCapacity ( size_t  n)
inline

fill n bytes with given symbol w/o checking for the size

Definition at line 76 of file PayLoadCont.h.

◆ erase()

void o2::itsmft::PayLoadCont::erase ( size_t  n)
inline

fill n bytes with given symbol

Definition at line 111 of file PayLoadCont.h.

◆ eraseFast()

void o2::itsmft::PayLoadCont::eraseFast ( size_t  n)
inline

erase n bytes

Definition at line 108 of file PayLoadCont.h.

◆ expand()

void PayLoadCont::expand ( size_t  sz)

< increase the buffer size

Definition at line 46 of file PayLoadCont.cxx.

◆ fill()

void o2::itsmft::PayLoadCont::fill ( const uint8_t  c,
size_t  n 
)
inline

add n bytes to the buffer, expand if needed. no check for overlap

Definition at line 121 of file PayLoadCont.h.

◆ fillFast()

void o2::itsmft::PayLoadCont::fillFast ( const uint8_t  c,
size_t  n 
)
inline

add n bytes to the buffer w/o checking for the size

Definition at line 84 of file PayLoadCont.h.

◆ getCapacity()

size_t o2::itsmft::PayLoadCont::getCapacity ( ) const
inline

number of bytes still can accept w/o expanding the buffer

Definition at line 70 of file PayLoadCont.h.

◆ getEnd()

uint8_t * o2::itsmft::PayLoadCont::getEnd ( )
inline

Definition at line 221 of file PayLoadCont.h.

◆ getFreeCapacity()

size_t o2::itsmft::PayLoadCont::getFreeCapacity ( ) const
inline

make sure buffer may accept at least n bytes

Definition at line 73 of file PayLoadCont.h.

◆ getOffset()

size_t o2::itsmft::PayLoadCont::getOffset ( ) const
inline

booked capacity

Definition at line 67 of file PayLoadCont.h.

◆ getPtr()

uint8_t * o2::itsmft::PayLoadCont::getPtr ( )
inline

direct write access

Definition at line 218 of file PayLoadCont.h.

◆ getSize()

size_t o2::itsmft::PayLoadCont::getSize ( ) const
inline

get offset of the current ptr from the head

Definition at line 64 of file PayLoadCont.h.

◆ getUnusedSize()

size_t o2::itsmft::PayLoadCont::getUnusedSize ( ) const
inline

get filled size

Definition at line 61 of file PayLoadCont.h.

◆ isEmpty()

bool o2::itsmft::PayLoadCont::isEmpty ( ) const
inline

make buffer empty w/o deallocating it

Definition at line 51 of file PayLoadCont.h.

◆ moveUnusedToHead()

void o2::itsmft::PayLoadCont::moveUnusedToHead ( )
inline

move unused data to the head and upload new chunk of data

Definition at line 195 of file PayLoadCont.h.

◆ next() [1/2]

bool o2::itsmft::PayLoadCont::next ( uint16_t &  v)
inline

move current pointer to the head

Definition at line 181 of file PayLoadCont.h.

◆ next() [2/2]

bool o2::itsmft::PayLoadCont::next ( uint8_t &  v)
inline

read short value from buffer

Definition at line 171 of file PayLoadCont.h.

◆ operator=()

PayLoadCont & PayLoadCont::operator= ( const PayLoadCont src)

Definition at line 32 of file PayLoadCont.cxx.

◆ operator[]() [1/2]

uint8_t & o2::itsmft::PayLoadCont::operator[] ( size_t  i)
inline

read current character value from buffer w/o stepping forward

Definition at line 158 of file PayLoadCont.h.

◆ operator[]() [2/2]

uint8_t o2::itsmft::PayLoadCont::operator[] ( size_t  i) const
inline

direct access to value at a given slot, w/o checking for overflow

Definition at line 155 of file PayLoadCont.h.

◆ rewind()

void o2::itsmft::PayLoadCont::rewind ( )
inline

move all data between the mPtr and mEnd to the head of the buffer

Definition at line 192 of file PayLoadCont.h.

◆ setEnd()

void o2::itsmft::PayLoadCont::setEnd ( uint8_t *  ptr)
inline

Definition at line 222 of file PayLoadCont.h.

◆ setPtr()

void o2::itsmft::PayLoadCont::setPtr ( uint8_t *  ptr)
inline

Definition at line 219 of file PayLoadCont.h.

◆ shrinkToSize()

void o2::itsmft::PayLoadCont::shrinkToSize ( size_t  sz)
inline

direct const access to value at a given slot, w/o checking for overflow

Definition at line 149 of file PayLoadCont.h.

Member Data Documentation

◆ MinCapacity

constexpr size_t PayLoadCont::MinCapacity = 16
staticconstexpr

allocate buffer

Definition at line 35 of file PayLoadCont.h.


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