30#define DOLOOP for(int k=0; k<narr; ++k)
32#define WriteBasicTypeElem(name,index) \
34 name *x=(name*)(arr[index]+ioffset); \
38#define WriteBasicType(name) \
40 WriteBasicTypeElem(name,0); \
43#define WriteBasicTypeLoop(name) \
45 for(int k=0; k<narr; ++k) WriteBasicTypeElem(name,k); \
48#define WriteBasicArrayElem(name,index) \
50 name *x=(name*)(arr[index]+ioffset); \
51 b.WriteFastArray(x,compinfo[i]->fLength); \
54#define WriteBasicArray(name) \
56 WriteBasicArrayElem(name,0); \
59#define WriteBasicArrayLoop(name) \
61 for(int k=0; k<narr; ++k) WriteBasicArrayElem(name,k); \
64#define WriteBasicPointerElem(name,index) \
66 Int_t *l = (Int_t*)(arr[index]+imethod); \
67 name **f = (name**)(arr[index]+ioffset); \
69 if (af && *l) b << Char_t(1); \
70 else {b << Char_t(0); continue;} \
72 for(j=0;j<compinfo[i]->fLength;j++) { \
73 b.WriteFastArray(f[j],*l); \
77#define WriteBasicPointer(name) \
79 int imethod = compinfo[i]->fMethod+eoffset; \
80 WriteBasicPointerElem(name,0); \
83#define WriteBasicPointerLoop(name) \
85 int imethod = compinfo[i]->fMethod+eoffset; \
86 for(int k=0; k<narr; ++k) { \
87 WriteBasicPointerElem(name,k); \
118 Bool_t needIncrement = !( arrayMode & 2 );
119 arrayMode = arrayMode & (~2);
121 if (needIncrement)
b.IncrementLevel(
this);
124 b.TagStreamerInfo(
this);
136 static const int kHaveLoop = 1024;
137 const Int_t typeOffset = arrayMode ? kHaveLoop : 0;
139 for (
Int_t i=first;i<last;i++) {
143 if (needIncrement)
b.SetStreamerElementNumber(aElement,compinfo[i]->fType);
147 if (R__TestUseCache<T>(aElement)) {
150 Warning(
"WriteBuffer",
"Skipping %s::%s because the cache is missing.",
GetName(),aElement->
GetName());
153 printf(
"WriteBuffer, class:%s, name=%s, fType[%d]=%d,"
154 " %s, bufpos=%d, arr=%p, eoffset=%d, Redirect=%p\n",
163 printf(
"WriteBuffer, class:%s, name=%s, fType[%d]=%d,"
164 " %s, bufpos=%d, arr=%p, eoffset=%d, not a write rule, skipping.\n",
166 aElement->
ClassName(),
b.Length(),arr[0], eoffset);
171 ioffset = eoffset+compinfo[i]->
fOffset;
177 printf(
"WriteBuffer, class:%s, name=%s, fType[%d]=%d, %s, "
178 "bufpos=%d, arr=%p, offset=%d\n",
180 b.Length(),arr[0],ioffset);
183 switch (compinfo[i]->fType+typeOffset) {
203 b.WriteFloat16(
x,aElement);
208 b.WriteDouble32(
x,aElement);
226 for(
int k=0; k<narr; ++k) {
228 b.WriteFloat16(
x,aElement);
233 for(
int k=0; k<narr; ++k) {
235 b.WriteDouble32(
x,aElement);
255 b.WriteFastArrayFloat16((
Float_t*)(arr[0]+ioffset),compinfo[i]->fLength,aElement);
259 b.WriteFastArrayDouble32((
Double_t*)(arr[0]+ioffset),compinfo[i]->fLength,aElement);
277 for(
int k=0; k<narr; ++k) {
278 b.WriteFastArrayFloat16((
Float_t*)(arr[k]+ioffset),compinfo[i]->fLength,aElement);
283 for(
int k=0; k<narr; ++k) {
284 b.WriteFastArrayDouble32((
Double_t*)(arr[k]+ioffset),compinfo[i]->fLength,aElement);
304 int imethod = compinfo[i]->
fMethod+eoffset;
309 else {
b <<
Char_t(0);
continue;}
311 for(j=0;j<compinfo[i]->
fLength;j++) {
312 b.WriteFastArrayFloat16(
f[j],*
l,aElement);
317 int imethod = compinfo[i]->
fMethod+eoffset;
322 else {
b <<
Char_t(0);
continue;}
324 for(j=0;j<compinfo[i]->
fLength;j++) {
325 b.WriteFastArrayDouble32(
f[j],*
l,aElement);
344 int imethod = compinfo[i]->
fMethod+eoffset;
345 for(
int k=0; k<narr; ++k) {
350 else {
b <<
Char_t(0);
continue;}
352 for(j=0;j<compinfo[i]->
fLength;j++) {
353 b.WriteFastArrayFloat16(
f[j],*
l,aElement);
359 int imethod = compinfo[i]->
fMethod+eoffset;
360 for(
int k=0; k<narr; ++k) {
365 else {
b <<
Char_t(0);
continue;}
367 for(j=0;j<compinfo[i]->
fLength;j++) {
368 b.WriteFastArrayDouble32(
f[j],*
l,aElement);
378 if (needIncrement)
b.DecrementLevel(
this);
396 switch (compinfo[i]->fType) {
400 char **
f = (
char**)(arr[k]+ioffset);
408 const auto parent =
b.GetParent();
412 b << (*
x & (~kIsOnHeap & ~kNotDeleted));
446 Int_t res =
b.WriteFastArray((
void**)(arr[k]+ioffset),cl,compinfo[i]->fLength,isPreAlloc,pstreamer);
449 "The actual class of %s::%s is not available. Only the \"%s\" part will be written\n",
461 void **
f = (
void**)(arr[k]+ioffset);
463 for(j=0;j<compinfo[i]->
fLength;j++) {
466 else {
b <<
Char_t(0);
continue;}
467 if (pstreamer) (*pstreamer)(
b, af, 0);
515 && !(strspn(aElement->
GetTitle(),
"||") == 2)
522 char **contp = (
char**)(arr[k]+ioffset);
523 for(
int j=0;j<compinfo[i]->
fLength;++j) {
524 char *cont = contp[j];
526 Int_t nobjects = cont ? proxy->
Size() : 0;
533 void *begin = &(startbuf[0]);
534 void *end = &(endbuf[0]);
538 b.ApplySequence(*actions, begin, end);
540 if (begin != &(startbuf[0])) {
547 b.SetByteCount(pos,
kTRUE);
551 if (pstreamer == 0) {
553 char **contp = (
char**)(arr[k]+ioffset);
554 for(
int j=0;j<compinfo[i]->
fLength;++j) {
555 char *cont = contp[j];
562 b.SetByteCount(pos,
kTRUE);
576 && !(strspn(aElement->
GetTitle(),
"||") == 2)
583 char *obj = (
char*)(arr[k]+ioffset);
597 void *begin = &(startbuf[0]);
598 void *end = &(endbuf[0]);
602 b.ApplySequence(*actions, begin, end);
603 if (begin != &(startbuf[0])) {
610 b.SetByteCount(pos,
kTRUE);
614 if (pstreamer == 0) {
616 b.WriteFastArray((
void*)(arr[k]+ioffset),cl,compinfo[i]->fLength,0);
621 b.SetByteCount(pos,
kTRUE);
633 {
b.WriteFastArray((
void*)(arr[k]+ioffset),cl,compinfo[i]->fLength,pstreamer);}
646 b.SetByteCount(pos,
kTRUE);
652 if (!(arrayMode&1)) {
658 b.SetByteCount(pos,
kTRUE);
674 if (pstreamer == 0) {
675 printf(
"ERROR, Streamer is null\n");
676 aElement->
ls();
continue;
680 b.SetByteCount(pos,
kTRUE);
705 for (
int k = 0; k < narr; ++k) {
707 Int_t* counter = (
Int_t*) (arr[k] + eoffset + compinfo[i]->fMethod );
709 (*pstreamer)(
b, arr[k] + ioffset , *counter);
711 b.SetByteCount(pos,
kTRUE);
725 if (fileVersion > 51508) {
728 for (
int k = 0; k < narr; ++k) {
730 Int_t vlen = *((
Int_t*) (arr[k] + eoffset + compinfo[i]->fMethod ));
734 char** pp = (
char**) (arr[k] + ioffset );
736 for (
Int_t ndx = 0; ndx < compinfo[i]->
fLength; ++ndx) {
746 b.WriteFastArray(pp[ndx], cl, vlen, 0);
752 b.WriteFastArray((
void**) pp[ndx], cl, vlen,
kFALSE, 0);
761 for (
int k = 0; k < narr; ++k) {
763 Int_t vlen = *((
Int_t*) (arr[k] + eoffset + compinfo[i]->fMethod ));
767 char** pp = (
char**) (arr[k] + ioffset );
770 for (
Int_t ndx = 0; ndx < compinfo[i]->
fLength; ++ndx) {
789 char**
r = (
char**) pp[ndx];
799 b.SetByteCount(pos,
kTRUE);
811 ROOT::TSchemaRule::WriteFuncPtr_t writefunc = ((
TStreamerArtificial*)aElement)->GetWriteFunc();
813 DOLOOP( writefunc(arr[k]+eoffset,
b) );
826 if (needIncrement)
b.DecrementLevel(
this);
875 char **arr =
reinterpret_cast<char**
>(clones->
GetObjectRef(0));
#define R__unlikely(expr)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned long long ULong64_t
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char mode
#define WriteBasicArray(name)
#define WriteBasicPointer(name)
#define WriteBasicPointerLoop(name)
#define WriteBasicArrayLoop(name)
#define WriteBasicTypeLoop(name)
#define WriteBasicType(name)
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
Buffer base class used for serializing objects.
@ kCannotHandleMemberWiseStreaming
virtual void WriteFastArray(const Bool_t *b, Long64_t n)=0
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
TClass instances represent classes, structs and namespaces in the ROOT type system.
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=nullptr) const
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
Bool_t HasCustomStreamerMember() const
The class has a Streamer method and it is implemented by the user or an older (not StreamerInfo based...
Int_t Size() const
Return size of object of this class.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
An array of clone (identical) objects.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
@ k630forwardCompatibility
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
void Streamer(TBuffer &) override
Stream an object of class TObject.
const char * GetTitle() const override
Returns title of object.
TObject ** GetObjectRef() const
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
@ kIsReferenced
if object is referenced by a TRef or TRefArray
A TProcessID identifies a ROOT job in a unique way in time and space.
static TProcessID * GetProcessWithUID(const TObject *obj)
static function returning a pointer to TProcessID with its pid encoded in the highest byte of obj->Ge...
A TRefTable maintains the association between a referenced object and the parent object supporting th...
static TRefTable * GetRefTable()
Static function returning the current TRefTable.
virtual Int_t Add(Int_t uid, TProcessID *context=nullptr)
Add a new uid to the table.
virtual const char * GetFullName() const
Return element name including dimensions, if any Note that this function stores the name into a stati...
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
void ls(Option_t *option="") const override
Print the content of the element.
const char * GetTypeName() const
TClass * fClass
Not Owned.
TMemberStreamer * fStreamer
Not Owned.
Describes a persistent version of a class.
Int_t fNfulldata
!number of elements
Int_t WriteBufferSTL(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc)
Write for STL container. ('first' is an id between -1 and fNfulldata).
TCompInfo ** fCompFull
![fElements->GetEntries()]
@ kArtificial
Cache the value in memory than is not part of the object but is accessible via a SchemaRule.
@ kUChar
Equal to TDataType's kchar.
Int_t fNdata
!number of optimized elements
TClass * IsA() const override
TClass * fClass
!pointer to class
TCompInfo ** fCompOpt
![fNdata]
void Streamer(TBuffer &) override
Stream an object of class TStreamerInfo.
Int_t WriteBuffer(TBuffer &b, char *pointer, Int_t first)
General Write.
Int_t WriteBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset)
Write for ClonesArray ('first' is an id between -1 and fNfulldata).
Int_t WriteBufferAux(TBuffer &b, const T &arr, TCompInfo *const *const compinfo, Int_t first, Int_t last, Int_t narr, Int_t eoffset, Int_t mode)
The object at pointer is serialized to the buffer b if (arrayMode & 1) ptr is a pointer to array of p...
Int_t WriteBufferSTLPtrs(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc, Int_t first, Int_t eoffset)
Write for STL container.
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
RAII helper class that ensures that PushProxy() / PopProxy() are called when entering / leaving a C++...
Defines a common interface to inspect/change the contents of an object that represents a collection.
virtual TStreamerInfoActions::TActionSequence * GetWriteMemberWiseActions()=0
virtual TClass * GetValueClass() const =0
If the value type is a user-defined class, return a pointer to the TClass representing the value type...
virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators(Bool_t read=kTRUE)=0
virtual UInt_t Size() const =0
Return the current number of elements in the container.
static const Int_t fgIteratorArenaSize
The size of a small buffer that can be allocated on the stack to store iterator-specific information.
virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read=kTRUE)=0
Return a pointer to a function that can create an iterator pair, where each iterator points to the be...
static Bool_t GetStreamMemberWise()
Return whether the TStreamerInfos will save the collections in "member-wise" order whenever possible.