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;
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);
441 Int_t res =
b.WriteFastArray((
void**)(arr[k]+ioffset),cl,compinfo[i]->fLength,isPreAlloc,pstreamer);
444 "The actual class of %s::%s is not available. Only the \"%s\" part will be written\n",
456 void **
f = (
void**)(arr[k]+ioffset);
458 for(j=0;j<compinfo[i]->
fLength;j++) {
461 else {
b <<
Char_t(0);
continue;}
462 if (pstreamer) (*pstreamer)(
b, af, 0);
510 && !(strspn(aElement->
GetTitle(),
"||") == 2)
514 UInt_t pos =
b.WriteVersionMemberWise(this->IsA(),
kTRUE);
515 b.WriteVersion( vClass,
kFALSE );
517 char **contp = (
char**)(arr[k]+ioffset);
518 for(
int j=0;j<compinfo[i]->
fLength;++j) {
519 char *cont = contp[j];
521 Int_t nobjects = cont ? proxy->
Size() : 0;
528 void *begin = &(startbuf[0]);
529 void *end = &(endbuf[0]);
533 b.ApplySequence(*actions, begin, end);
535 if (begin != &(startbuf[0])) {
542 b.SetByteCount(pos,
kTRUE);
546 if (pstreamer == 0) {
548 char **contp = (
char**)(arr[k]+ioffset);
549 for(
int j=0;j<compinfo[i]->
fLength;++j) {
550 char *cont = contp[j];
557 b.SetByteCount(pos,
kTRUE);
571 && !(strspn(aElement->
GetTitle(),
"||") == 2)
575 UInt_t pos =
b.WriteVersionMemberWise(this->IsA(),
kTRUE);
576 b.WriteVersion( vClass,
kFALSE );
578 char *obj = (
char*)(arr[k]+ioffset);
592 void *begin = &(startbuf[0]);
593 void *end = &(endbuf[0]);
597 b.ApplySequence(*actions, begin, end);
598 if (begin != &(startbuf[0])) {
605 b.SetByteCount(pos,
kTRUE);
609 if (pstreamer == 0) {
611 b.WriteFastArray((
void*)(arr[k]+ioffset),cl,compinfo[i]->fLength,0);
616 b.SetByteCount(pos,
kTRUE);
628 {
b.WriteFastArray((
void*)(arr[k]+ioffset),cl,compinfo[i]->fLength,pstreamer);}
640 DOLOOP {
b.WriteFastArray((
void*)(arr[k]+ioffset),cl,compinfo[i]->fLength,pstreamer);}
641 b.SetByteCount(pos,
kTRUE);
647 if (!(arrayMode&1)) {
653 b.SetByteCount(pos,
kTRUE);
669 if (pstreamer == 0) {
670 printf(
"ERROR, Streamer is null\n");
671 aElement->
ls();
continue;
675 b.SetByteCount(pos,
kTRUE);
700 for (
int k = 0; k < narr; ++k) {
702 Int_t* counter = (
Int_t*) (arr[k] + eoffset + compinfo[i]->fMethod );
704 (*pstreamer)(
b, arr[k] + ioffset , *counter);
706 b.SetByteCount(pos,
kTRUE);
716 fileVersion =
file->GetVersion();
720 if (fileVersion > 51508) {
723 for (
int k = 0; k < narr; ++k) {
725 Int_t vlen = *((
Int_t*) (arr[k] + eoffset + compinfo[i]->fMethod ));
729 char** pp = (
char**) (arr[k] + ioffset );
731 for (
Int_t ndx = 0; ndx < compinfo[i]->
fLength; ++ndx) {
741 b.WriteFastArray(pp[ndx], cl, vlen, 0);
747 b.WriteFastArray((
void**) pp[ndx], cl, vlen,
kFALSE, 0);
756 for (
int k = 0; k < narr; ++k) {
758 Int_t vlen = *((
Int_t*) (arr[k] + eoffset + compinfo[i]->fMethod ));
762 char** pp = (
char**) (arr[k] + ioffset );
765 for (
Int_t ndx = 0; ndx < compinfo[i]->
fLength; ++ndx) {
784 char**
r = (
char**) pp[ndx];
794 b.SetByteCount(pos,
kTRUE);
806 ROOT::TSchemaRule::WriteFuncPtr_t writefunc = ((
TStreamerArtificial*)aElement)->GetWriteFunc();
808 DOLOOP( writefunc(arr[k]+eoffset,
b) );
821 if (needIncrement)
b.DecrementLevel(
this);
870 char **arr =
reinterpret_cast<char**
>(clones->
GetObjectRef(0));
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned long long ULong64_t
#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
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
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).
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
@ kHasCustomStreamerMember
An array of clone (identical) objects.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name 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 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=0)
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.
const char * GetTypeName() const
virtual void ls(Option_t *option="") const
Print the content of the element.
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 * fClass
!pointer to class
TCompInfo ** fCompOpt
![fNdata]
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...
virtual TStreamerInfoActions::TActionSequence * GetWriteMemberWiseActions()=0
virtual TClass * GetValueClass() const =0
virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators(Bool_t read=kTRUE)=0
virtual UInt_t Size() const =0
static const Int_t fgIteratorArenaSize
virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read=kTRUE)=0
static Bool_t GetStreamMemberWise()
Return whether the TStreamerInfos will save the collections in "member-wise" order whenever possible.