4 #include "base/TimeStamp.h"
70 bool null()
const {
return fRec==
nullptr; }
90 uint32_t
getuint32(
unsigned indx)
const {
return ((uint32_t*)
ptr())[indx]; }
Memory management class.
Definition: Buffer.h:49
uint32_t getuint32(unsigned indx) const
get uint32_t at given index
Definition: Buffer.h:90
Buffer & operator=(const Buffer &src)
assign operator
Definition: Buffer.h:61
Buffer(const Buffer &src)
constructor
Definition: Buffer.h:56
unsigned datalen() const
Returns length of memory buffer.
Definition: Buffer.h:81
void makecopyof(void *buf, unsigned datalen)
Method produces buffer instance with deep copy of provided raw data Means extra memory will be alloca...
Definition: Buffer.cxx:61
Buffer()
constructor
Definition: Buffer.h:54
RawDataRec & operator()(void) const
access operator
Definition: Buffer.h:75
void reset()
reset buffer
Definition: Buffer.cxx:10
bool setdatalen(unsigned newlen)
Change length of memory buffer - only can be reduced.
Definition: Buffer.cxx:22
~Buffer()
destructor
Definition: Buffer.h:58
RawDataRec & rec() const
access operator
Definition: Buffer.h:78
RawDataRec * fRec
data
Definition: Buffer.h:51
void makereferenceof(void *buf, unsigned datalen)
Method produces buffer instance with reference to provided raw data Means buffer will only contain po...
Definition: Buffer.cxx:88
void makenew(unsigned datalen)
Method produces empty buffer with specified amount of memory.
Definition: Buffer.cxx:37
void * ptr(unsigned shift=0) const
return pointer with shift
Definition: Buffer.h:87
Internal raw data for base::Buffer.
Definition: Buffer.h:10
GlobalTime_t global_tm
buffer head time in global time
Definition: Buffer.h:18
unsigned kind
like ROC event, SPADIC or MBS or ..
Definition: Buffer.h:13
int refcnt
number of references
Definition: Buffer.h:11
unsigned boardid
board id
Definition: Buffer.h:14
unsigned format
raw data format like optic, Ethernet for ROC and so on
Definition: Buffer.h:15
unsigned user_tag
arbitrary data, can be used for any additional data
Definition: Buffer.h:23
unsigned datalen
length of raw data
Definition: Buffer.h:21
RawDataRec()
constructor
Definition: Buffer.h:26
GlobalTime_t local_tm
buffer head time in local scale,
Definition: Buffer.h:17
void reset()
reset
Definition: Buffer.h:29
void * buf
raw data
Definition: Buffer.h:20