Analysis Software
Documentation for sPHENIX simulation software
|
#include <online_distribution/blob/master/newbasic/mvtx_decoder/PayLoadCont.h>
Public Member Functions | |
PayLoadCont ()=default | |
PayLoadCont (size_t sz) | |
~PayLoadCont ()=default | |
PayLoadCont (const PayLoadCont &src) | |
PayLoadCont & | operator= (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) |
void | movePtr (size_t step) |
uint8_t * | getEnd () |
void | setEnd (uint8_t *ptr) |
Static Public Attributes | |
static constexpr size_t | MinCapacity = 16 |
allocate buffer | |
Private Attributes | |
std::vector< uint8_t > | mBuffer |
uint8_t * | mPtr = nullptr |
continuons data buffer | |
uint8_t * | mEnd = nullptr |
! pointer on the position in the buffer | |
Definition at line 18 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 18 of file PayLoadCont.h
|
default |
|
inline |
Definition at line 28 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 28 of file PayLoadCont.h
References expand().
|
default |
PayLoadCont::PayLoadCont | ( | const PayLoadCont & | src | ) |
Definition at line 13 of file PayLoadCont.cxx.
View newest version in sPHENIX GitHub at line 13 of file PayLoadCont.cxx
|
inline |
add new byte to the buffer
Definition at line 117 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 117 of file PayLoadCont.h
References addFast(), and ensureFreeCapacity().
Referenced by oncsSub_idmvtxv3::loadInput().
|
inline |
add new short to the buffer
Definition at line 124 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 124 of file PayLoadCont.h
References addFast(), and ensureFreeCapacity().
|
inline |
shrink buffer to requested size, no check on over/under flow
Definition at line 131 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 131 of file PayLoadCont.h
References addFast(), and ensureFreeCapacity().
|
inline |
add new byte to the buffer w/o checking for the size
Definition at line 80 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 80 of file PayLoadCont.h
Referenced by add().
|
inline |
add new short to the buffer w/o checking for the size
Definition at line 87 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 87 of file PayLoadCont.h
References mEnd.
|
inline |
erase n bytes w/o checking for the underflow
Definition at line 90 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 90 of file PayLoadCont.h
References mEnd.
|
inline |
Definition at line 198 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 198 of file PayLoadCont.h
References getFreeCapacity(), mEnd, and moveUnusedToHead().
|
inline |
get unused size
Definition at line 43 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 43 of file PayLoadCont.h
References mBuffer, mEnd, and mPtr.
Referenced by mvtx::GBTLink::AlpideByteError(), mvtx::GBTLink::clear(), erase(), and expand().
|
inline |
read character value from buffer
Definition at line 150 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 150 of file PayLoadCont.h
|
inline |
increase the buffer size
Definition at line 35 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 35 of file PayLoadCont.h
References mBuffer.
|
inline |
fill n bytes with given symbol w/o checking for the size
Definition at line 65 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 65 of file PayLoadCont.h
References expand(), getCapacity(), and getFreeCapacity().
Referenced by add(), and fill().
|
inline |
fill n bytes with given symbol
Definition at line 100 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 100 of file PayLoadCont.h
References clear(), eraseFast(), and getSize().
|
inline |
erase n bytes
Definition at line 97 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 97 of file PayLoadCont.h
Referenced by erase().
void PayLoadCont::expand | ( | size_t | sz | ) |
< increase the buffer size
Definition at line 40 of file PayLoadCont.cxx.
View newest version in sPHENIX GitHub at line 40 of file PayLoadCont.cxx
References clear(), mBuffer, mEnd, MinCapacity, and mPtr.
Referenced by ensureFreeCapacity(), mvtx::GBTLink::GBTLink(), and PayLoadCont().
|
inline |
add n bytes to the buffer, expand if needed. no check for overlap
Definition at line 110 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 110 of file PayLoadCont.h
References ensureFreeCapacity(), and fillFast().
|
inline |
add n bytes to the buffer w/o checking for the size
Definition at line 73 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 73 of file PayLoadCont.h
Referenced by fill().
|
inline |
number of bytes still can accept w/o expanding the buffer
Definition at line 59 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 59 of file PayLoadCont.h
References mBuffer.
Referenced by ensureFreeCapacity().
|
inline |
Definition at line 211 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 211 of file PayLoadCont.h
References mEnd.
|
inline |
make sure buffer may accept at least n bytes
Definition at line 62 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 62 of file PayLoadCont.h
References getSize(), and mBuffer.
Referenced by append(), and ensureFreeCapacity().
|
inline |
booked capacity
Definition at line 56 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 56 of file PayLoadCont.h
Referenced by mvtx::GBTLink::decode_lane(), and moveUnusedToHead().
|
inline |
direct write access
Definition at line 207 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 207 of file PayLoadCont.h
References mPtr.
Referenced by oncsSub_idmvtxv3::loadInput(), and mvtx::GBTLink::readFlxWord().
|
inline |
get offset of the current ptr from the head
Definition at line 53 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 53 of file PayLoadCont.h
Referenced by mvtx::GBTLink::decode_lane(), erase(), and getFreeCapacity().
|
inline |
get filled size
Definition at line 50 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 50 of file PayLoadCont.h
Referenced by mvtx::GBTLink::decode_lane(), moveUnusedToHead(), and oncsSub_idmvtxv3::setupLinks().
|
inline |
make buffer empty w/o deallocating it
Definition at line 40 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 40 of file PayLoadCont.h
Referenced by mvtx::GBTLink::clear(), and mvtx::GBTLink::decode_lane().
|
inline |
Definition at line 209 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 209 of file PayLoadCont.h
|
inline |
move unused data to the head and upload new chunk of data
Definition at line 184 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 184 of file PayLoadCont.h
References getOffset(), getUnusedSize(), left(), mBuffer, mEnd, and mPtr.
Referenced by append(), and mvtx::GBTLink::clear().
|
inline |
read short value from buffer
Definition at line 160 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 160 of file PayLoadCont.h
Referenced by mvtx::GBTLink::AlpideByteError(), and mvtx::GBTLink::decode_lane().
|
inline |
move current pointer to the head
Definition at line 170 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 170 of file PayLoadCont.h
PayLoadCont & PayLoadCont::operator= | ( | const PayLoadCont & | src | ) |
Definition at line 25 of file PayLoadCont.cxx.
View newest version in sPHENIX GitHub at line 25 of file PayLoadCont.cxx
|
inline |
direct access to value at a given slot, w/o checking for overflow
Definition at line 144 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 144 of file PayLoadCont.h
|
inline |
read current character value from buffer w/o stepping forward
Definition at line 147 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 147 of file PayLoadCont.h
|
inline |
move all data between the mPtr and mEnd to the head of the buffer
Definition at line 181 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 181 of file PayLoadCont.h
Referenced by pylhef(), and pyslha().
|
inline |
Definition at line 212 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 212 of file PayLoadCont.h
References mEnd.
|
inline |
Definition at line 208 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 208 of file PayLoadCont.h
References mPtr.
|
inline |
direct const access to value at a given slot, w/o checking for overflow
Definition at line 138 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 138 of file PayLoadCont.h
|
private |
Definition at line 215 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 215 of file PayLoadCont.h
Referenced by clear(), data(), expand(), getCapacity(), getFreeCapacity(), getOffset(), getSize(), moveUnusedToHead(), operator=(), operator[](), PayLoadCont(), and rewind().
|
private |
! pointer on the position in the buffer
Definition at line 217 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 217 of file PayLoadCont.h
Referenced by addFast(), append(), clear(), current(), eraseFast(), expand(), fillFast(), getEnd(), getSize(), getUnusedSize(), isEmpty(), moveUnusedToHead(), next(), operator=(), PayLoadCont(), setEnd(), and shrinkToSize().
|
static |
allocate buffer
continous buffer for the payload, just a preallocated vector with current position and end pointer. Big endian is used.
Definition at line 24 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 24 of file PayLoadCont.h
Referenced by expand().
|
private |
continuons data buffer
Definition at line 216 of file PayLoadCont.h.
View newest version in sPHENIX GitHub at line 216 of file PayLoadCont.h
Referenced by clear(), current(), expand(), getOffset(), getPtr(), getUnusedSize(), isEmpty(), movePtr(), moveUnusedToHead(), next(), operator=(), PayLoadCont(), rewind(), setPtr(), and shrinkToSize().