75 Fatal(
"TBuffer",
"Request to create a buffer with a negative size, likely due to an integer overflow: 0x%x for a max of 0x%x.", bufsize,
kMaxBufferSize);
106 Fatal(
"TBuffer",
"Request to create a buffer with a negative size, likely due to an integer overflow: 0x%x for a max of 0x%x.", bufsize,
kMaxBufferSize);
159 if (size_needed < 0) {
160 Fatal(
"AutoExpand",
"Request to expand to a negative size, likely due to an integer overflow: 0x%x for a max of 0x%x.", size_needed,
kMaxBufferSize);
166 if (size_needed > doubling) {
225 if ( (
l > newsize) && copy ) {
246 Fatal(
"Expand",
"Failed to expand the data buffer using TStorage::ReAllocChar.");
248 Fatal(
"Expand",
"Failed to expand the data buffer because TBuffer does not own it and no custom memory reallocator was provided.");
250 Fatal(
"Expand",
"Failed to expand the data buffer using custom memory reallocator 0x%zx.", (
size_t)
fReAllocFunc);
398 Short_t *buf __attribute__((aligned(8))) =
reinterpret_cast<Short_t*
>(input_buf);
399 for (
int idx=0; idx<
n; idx++) {
401 char *tmp_ptr =
reinterpret_cast<char *
>(&tmp);
407 Float_t *buf __attribute__((aligned(8))) =
reinterpret_cast<Float_t*
>(input_buf);
408 for (
int idx=0; idx<
n; idx++) {
410 char *tmp_ptr =
reinterpret_cast<char *
>(&tmp);
416 Double_t *buf __attribute__((aligned(8))) =
reinterpret_cast<Double_t*
>(input_buf);
417 for (
int idx=0; idx<
n; idx++) {
419 char *tmp_ptr =
reinterpret_cast<char*
>(&tmp);
void frombuf(char *&buf, Bool_t *x)
unsigned short UShort_t
Unsigned Short integer 2 bytes (unsigned short).
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Short_t
Signed Short integer 2 bytes (short).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
float Float_t
Float 4 bytes (float).
constexpr Int_t kExtraSpace
constexpr Int_t kMaxBufferSize
static char * R__NoReAllocChar(char *, size_t, size_t)
The user has provided memory than we don't own, thus we can not extent it either.
char *(* ReAllocCharFun_t)(char *, size_t, size_t)
Buffer base class used for serializing objects.
void SetWriteMode()
Set buffer in write mode.
Bool_t ByteSwapBuffer(Long64_t n, EDataType type)
Byte-swap N primitive-elements in the buffer.
virtual TProcessID * ReadProcessID(UShort_t pidf)=0
Return the current Process-ID.
virtual UShort_t WriteProcessID(TProcessID *pid)=0
Always return 0 (current processID).
void SetParent(TObject *parent)
Set parent owning this buffer.
TObject * GetParent() const
Return pointer to parent of this buffer.
char * GetCurrent() const
void Expand(Int_t newsize, Bool_t copy=kTRUE)
Expand (or shrink) the I/O buffer to newsize bytes.
virtual void PushDataCache(TVirtualArray *)
Push a new data cache area onto the list of area to be used for temporarily store 'missing' data memb...
void SetReAllocFunc(ReAllocCharFun_t reallocfunc=nullptr)
Set which memory reallocation method to use.
virtual TVirtualArray * PopDataCache()
Pop and Return the 'current' data cache area from the list of area to be used for temporarily store '...
void AutoExpand(Int_t size_needed)
Automatically calculate a new size and expand the buffer to fit at least size_needed.
virtual TVirtualArray * PeekDataCache() const
Return the 'current' data cache area from the list of area to be used for temporarily store 'missing'...
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual ~TBuffer()
Delete an I/O buffer object.
void SetBuffer(void *buf, UInt_t bufsize=0, Bool_t adopt=kTRUE, ReAllocCharFun_t reallocfunc=nullptr)
Sets a new buffer in an existing TBuffer object.
static TClass * GetClass(const std::type_info &typeinfo)
Forward to TROOT::GetClass().
ReAllocCharFun_t GetReAllocFunc() const
Return the reallocation method currently used.
ReAllocCharFun_t fReAllocFunc
! Realloc function to be used when extending the buffer.
void SetReadMode()
Set buffer in read mode.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TClass instances represent classes, structs and namespaces in the ROOT type system.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Bool_t TestBit(UInt_t f) const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
TObject()
TObject constructor.
A TProcessID identifies a ROOT job in a unique way in time and space.
static TProcessID * GetPID()
static: returns pointer to current TProcessID
static char * ReAllocChar(char *vp, size_t size, size_t oldsize)
Reallocate (i.e.
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
void DefaultStreamer(TBuffer &R__b, const TClass *cl, void *objpointer)
Default streamer implementation used by ClassDefInline to avoid requirement to include TBuffer....