100 return &itm.s_longlong;
142 return &itm.u_longlong;
145 template <
typename From,
typename To>
148 From *
r = getaddress<From>( *read );
149 To *
w = getaddress<To>( *write );
150 for(
int i = 0; i < nElements; ++i) {
156 template <
typename From>
161 ConvertArray<From,bool>(
read,
write,nElements);
164 ConvertArray<From,Char_t>(
read,
write,nElements);
167 ConvertArray<From,Short_t>(
read,
write,nElements);
170 ConvertArray<From,Int_t>(
read,
write,nElements);
173 ConvertArray<From,Long64_t>(
read,
write,nElements);
176 ConvertArray<From,Long64_t>(
read,
write,nElements);
179 ConvertArray<From,Float_t>(
read,
write,nElements);
182 ConvertArray<From,Float16_t>(
read,
write,nElements);
185 ConvertArray<From,Double_t>(
read,
write,nElements);
188 ConvertArray<From,bool>(
read,
write,nElements);
191 ConvertArray<From,UChar_t>(
read,
write,nElements);
194 ConvertArray<From,UShort_t>(
read,
write,nElements);
197 ConvertArray<From,UInt_t>(
read,
write,nElements);
200 ConvertArray<From,ULong_t>(
read,
write,nElements);
203 ConvertArray<From,ULong64_t>(
read,
write,nElements);
206 ConvertArray<From,Double32_t>(
read,
write,nElements);
211 Error(
"TGenCollectionStreamer",
"fType %d is not supported yet!\n", writeType);
239 itmstore = (
StreamHelper*)(len <
sizeof(buffer) ? buffer : memory =::operator
new(len));
306 Error(
"TGenCollectionStreamer",
"fType %d is not supported yet!\n", readkind);
311 DispatchConvertArray<bool>(
fVal->
fKind, itmread, itmstore, nElements);
314 DispatchConvertArray<Char_t>(
fVal->
fKind, itmread, itmstore, nElements);
317 DispatchConvertArray<Short_t>(
fVal->
fKind, itmread, itmstore, nElements);
320 DispatchConvertArray<Int_t>(
fVal->
fKind, itmread, itmstore, nElements);
323 DispatchConvertArray<Long_t>(
fVal->
fKind, itmread, itmstore, nElements);
326 DispatchConvertArray<Long64_t>(
fVal->
fKind, itmread, itmstore, nElements);
329 DispatchConvertArray<Float_t>(
fVal->
fKind, itmread, itmstore, nElements);
332 DispatchConvertArray<Float16_t>(
fVal->
fKind, itmread, itmstore, nElements);
335 DispatchConvertArray<Double_t>(
fVal->
fKind, itmread, itmstore, nElements);
338 DispatchConvertArray<bool>(
fVal->
fKind, itmread, itmstore, nElements);
341 DispatchConvertArray<UChar_t>(
fVal->
fKind, itmread, itmstore, nElements);
344 DispatchConvertArray<UShort_t>(
fVal->
fKind, itmread, itmstore, nElements);
347 DispatchConvertArray<UInt_t>(
fVal->
fKind, itmread, itmstore, nElements);
350 DispatchConvertArray<ULong_t>(
fVal->
fKind, itmread, itmstore, nElements);
353 DispatchConvertArray<ULong64_t>(
fVal->
fKind, itmread, itmstore, nElements);
356 DispatchConvertArray<Double_t>(
fVal->
fKind, itmread, itmstore, nElements);
361 Error(
"TGenCollectionStreamer",
"fType %d is not supported yet!\n", readkind);
363 ::operator
delete((
void*)itmconv);
368 ::operator
delete(memory);
388 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)(((char*)itm) + fValDiff*idx); { x ;} ++idx;} break;}
402 DOLOOP(i->read_std_string(b));
406 DOLOOP(i->read_std_string_pointer(b));
408 DOLOOP(i->read_tstring_pointer(vsn3, b));
418 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)TGenCollectionProxy::At(idx); { x ;} ++idx;} break;}
426 DOLOOP(i->read_std_string(b));
430 DOLOOP(i->read_std_string_pointer(b));
432 DOLOOP(i->read_tstring_pointer(vsn3, b));
443 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)(((char*)itm) + fValDiff*idx); { x ;} ++idx;}}
453 DOLOOP(i->read_std_string(b))
462 DOLOOP(i->read_std_string_pointer(b))
466 DOLOOP(i->read_tstring_pointer(vsn3, b));
476 ::operator
delete(memory);
495 std::vector<std::string> inside;
505 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)(((char*)itm) + fValDiff*idx); { x ;} ++idx;} break;}
530 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)TGenCollectionProxy::At(idx); { x ;} ++idx;} break;}
541 char **where = (
char**)(
void*) & i;
554 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)(((char*)itm) + fValDiff*idx); { x ;} ++idx;}}
560 char **where = (
char**)(
void*) & i;
573 ::operator
delete(memory);
587 switch (
int(v->
fKind)) {
641 Error(
"TGenCollectionStreamer",
"fType %d is not supported yet!\n", v->
fKind);
662 template <
typename To>
737 Error(
"TGenCollectionStreamer",
"fType %d is not supported yet!\n", readtype);
749 char buffer[8096], *addr, *temp;
754 fEnv->
fStart = (len <
sizeof(
buffer) ? buffer : memory =::
operator new(len));
758 int onFileValueKind[2];
765 for (
int loop, idx = 0; idx < nElements; ++idx) {
768 for (loop = 0; loop < 2; loop++) {
774 int readtype = (int)(onFileValueKind[loop]);
775 switch (
int(v->
fKind)) {
777 i->
boolean = readOneValue<bool>(b,readtype);
780 i->
s_char = readOneValue<Char_t>(b,readtype);
783 i->
s_short = readOneValue<Short_t>(b,readtype);
786 i->
s_int = readOneValue<Int_t>(b,readtype);
789 i->
s_long = readOneValue<Long_t>(b,readtype);
792 i->
s_longlong = readOneValue<Long64_t>(b,readtype);
795 i->
flt = readOneValue<Float_t>(b,readtype);
798 i->
flt = readOneValue<Float16_t>(b,readtype);
801 i->
dbl = readOneValue<Double_t>(b,readtype);
804 i->
boolean = readOneValue<bool>(b,readtype);
807 i->
u_char = readOneValue<UChar_t>(b,readtype);
810 i->
u_short = readOneValue<UShort_t>(b,readtype);
813 i->
u_int = readOneValue<UInt_t>(b,readtype);
816 i->
u_long = readOneValue<ULong_t>(b,readtype);
819 i->
u_longlong = readOneValue<ULong64_t>(b,readtype);
822 i->
dbl = readOneValue<Double32_t>(b,readtype);
827 Error(
"TGenCollectionStreamer",
"fType %d is not supported yet!\n", v->
fKind);
830 switch (
int(v->
fKind)) {
884 Error(
"TGenCollectionStreamer",
"fType %d is not supported yet!\n", v->
fKind);
911 ::operator
delete(memory);
985 Error(
"TGenCollectionStreamer",
"fType %d is not supported yet!\n",
fVal->
fKind);
988 ::operator
delete(memory);
999 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)(((char*)itm) + fValDiff*idx); { x ;} ++idx;} break;}
1012 DOLOOP(i->write_std_string_pointer(b));
1015 DOLOOP(i->write_tstring_pointer(b));
1030 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)TGenCollectionProxy::At(idx); { x ;} ++idx;} break;}
1039 DOLOOP(i->write_std_string_pointer(b));
1041 DOLOOP(i->write_tstring_pointer(b));
1056 for (
int loop, idx = 0; idx < nElements; ++idx) {
1059 for (loop = 0; loop < 2; ++loop) {
1064 switch (
int(v->
fKind)) {
1116 Error(
"TGenCollectionStreamer",
"fType %d is not supported yet!\n", v->
fKind);
1141 template <
typename From,
typename To>
1144 From *temp =
new From[nElements];
1146 std::vector<To> *
const vec = (std::vector<To>*)(obj);
1147 for(
Int_t ind = 0; ind < nElements; ++ind) {
1148 (*vec)[ind] = (To)temp[ind];
1153 template <
typename To>
1158 std::vector<To> *
const vec = (std::vector<To>*)(obj);
1159 for(
Int_t ind = 0; ind < nElements; ++ind) {
1160 (*vec)[ind] = (To)temp[ind];
1165 template <
typename To>
1170 std::vector<To> *
const vec = (std::vector<To>*)(obj);
1171 for(
Int_t ind = 0; ind < nElements; ++ind) {
1172 (*vec)[ind] = (To)temp[ind];
1177 template <
typename To>
1200 template <
typename basictype>
1208 DispatchConvertBufferVectorPrimitives<basictype>(b,
obj,nElements,onFileClass->
GetCollectionProxy());
1223 DispatchConvertBufferVectorPrimitives<Float16_t>(b,
obj,nElements,onFileClass->
GetCollectionProxy());
1238 DispatchConvertBufferVectorPrimitives<Double32_t>(b,
obj,nElements,onFileClass->
GetCollectionProxy());
1272 Fatal(
"TGenCollectionStreamer::ReadBufferDefault",
"No CreateIterators function for %s",
fName.c_str());
1282 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<Char_t>;
1285 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<Short_t>;
1288 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<Int_t>;
1291 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<Long_t>;
1294 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<Long64_t>;
1297 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<Float_t>;
1303 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<Double_t>;
1309 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<UChar_t>;
1312 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<UShort_t>;
1315 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<UInt_t>;
1318 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<ULong_t>;
1321 fReadBufferFunc = &TGenCollectionStreamer::ReadBufferVectorPrimitives<ULong64_t>;
1343 if (nElements == 0) {
1347 }
else if (nElements > 0) {
1413 ReadMap(nElements, b, onFileClass);
1428 if (nElements > 0) {
1461 if (nElements > 0) {
1504 if (nElements > 0) {
Describe Streamer information for one class version.
Method fSize
Container accessors: size of container.
UShort_t * getaddress< UShort_t >(TGenCollectionProxy::StreamHelper &itm)
double read(const std::string &file_name)
reading
virtual void ReadBuffer(TBuffer &b, void *obj, const TClass *onfileClass)
virtual void WriteFastArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0)=0
void ReadBufferVectorPrimitivesDouble32(TBuffer &b, void *obj, const TClass *onFileClass)
void * invoke(void *obj) const
void CreateIterators(void *collection)
ULong_t * getaddress< ULong_t >(TGenCollectionProxy::StreamHelper &itm)
void WriteMap(int nElements, TBuffer &b)
double write(int n, const std::string &file_name, const std::string &vector_type, int compress=0)
writing
void Fatal(const char *location, const char *msgfmt,...)
Equal to TDataType's kchar.
TGenCollectionProxy * Initialize(Bool_t silent) const
Proxy initializer.
Collectfunc_t fCollect
Method to collect objects from container.
virtual void StreamObject(void *obj, const type_info &typeinfo, const TClass *onFileClass=0)=0
std::string fName
Name of the class being proxied.
virtual TClass * GetValueClass() const =0
int GetSplit(const char *type, std::vector< std::string > &output, int &nestedLoc, EModType mode=TClassEdit::kNone)
Stores in output (after emptying it) the splited type.
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass)=0
Char_t * getaddress< Char_t >(TGenCollectionProxy::StreamHelper &itm)
void write_tstring_pointer(TBuffer &b)
static T * getaddress(TGenCollectionProxy::StreamHelper &itm)
Method fFirst
Container accessors: generic iteration: first.
Buffer base class used for serializing objects.
void ReadBufferGeneric(TBuffer &b, void *obj, const TClass *onFileClass)
TClass * fOnFileClass
On file class.
Feedfunc_t fFeed
Container accessors: block feed.
TGenCollectionStreamer(const TGenCollectionStreamer ©)
void ReadPrimitives(int nElements, TBuffer &b, const TClass *onfileClass)
UInt_t fCase
type of data of Value_type
void DispatchConvertArray(int writeType, TGenCollectionProxy::StreamHelper *read, TGenCollectionProxy::StreamHelper *write, int nElements)
virtual EDataType GetType() const =0
Sizing_t fResize
Container accessors: resize container.
void ReadPairFromMap(int nElements, TBuffer &b)
virtual TVirtualStreamerInfo * GetInfo()=0
V GetOffset(E val1, E val2, V iso)
Long64_t * getaddress< Long64_t >(TGenCollectionProxy::StreamHelper &itm)
virtual void StreamerAsMap(TBuffer &refBuffer)
void ConvertBufferVectorPrimitives(TBuffer &b, void *obj, Int_t nElements)
void read_std_string(TBuffer &b)
To readOneValue(TBuffer &b, int readtype)
virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read=kTRUE)
See typedef void (*CreateIterators_t)(void *collection, void *&begin_arena, void *&end_arena); begin_...
void WritePrimitives(int nElements, TBuffer &b)
Short_t * getaddress< Short_t >(TGenCollectionProxy::StreamHelper &itm)
void WriteObjects(int nElements, TBuffer &b)
Method fClear
Method cache for container accessors: clear container.
ArrIterfunc_t fConstruct
Container accessors: block construct.
void Error(const char *location, const char *msgfmt,...)
EDataType fKind
kind of ROOT-fundamental type
void ReadBufferDefault(TBuffer &b, void *obj, const TClass *onFileClass)
virtual EDataType GetType() const
If the content is a simple numerical value, return its type (see TDataType)
UChar_t * getaddress< UChar_t >(TGenCollectionProxy::StreamHelper &itm)
int fValOffset
Offset from key to value (in maps)
ReadBuffer_t fReadBufferFunc
void read_std_string_pointer(TBuffer &b)
TObjArray * GetElements() const
virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0)=0
int fSTL_type
STL container type.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
Long_t * getaddress< Long_t >(TGenCollectionProxy::StreamHelper &itm)
virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object)=0
virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0)=0
virtual const char * GetName() const
Returns name of object.
void ReadBufferVectorPrimitivesFloat16(TBuffer &b, void *obj, const TClass *onFileClass)
CreateIterators_t fFunctionCreateIterators
The ROOT global object gROOT contains a list of all defined classes.
void ReadMap(int nElements, TBuffer &b, const TClass *onfileClass)
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
void ConvertBufferVectorPrimitivesDouble32(TBuffer &b, void *obj, Int_t nElements)
virtual void WriteFastArray(const Bool_t *b, Int_t n)=0
int fValDiff
Offset between two consecutive value_types (memory layout).
virtual ULong_t GetIncrement() const =0
ULong64_t * getaddress< ULong64_t >(TGenCollectionProxy::StreamHelper &itm)
void ReadBufferVectorPrimitives(TBuffer &b, void *obj, const TClass *onFileClass)
Float_t * getaddress< Float_t >(TGenCollectionProxy::StreamHelper &itm)
virtual TObjArray * GetElements() const =0
virtual TGenCollectionProxy * InitializeEx(Bool_t silent)
Proxy initializer.
unsigned long long ULong64_t
UInt_t * getaddress< UInt_t >(TGenCollectionProxy::StreamHelper &itm)
void write_std_string_pointer(TBuffer &b)
virtual void * ReadObjectAny(const TClass *cast)=0
virtual Version_t GetOldVersion() const =0
std::atomic< Value * > fValue
Descriptor of the container value type.
TClassRef fType
TClass reference of Value_type in collection.
virtual void Clear(const char *opt="")
Clear the emulated collection.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
virtual void * At(UInt_t idx)
Return the address of the value at index 'idx'.
Value * fKey
Descriptor of the key_type.
void ConvertBufferVectorPrimitivesFloat16(TBuffer &b, void *obj, Int_t nElements)
virtual void Streamer(TBuffer &refBuffer)
Streamer Function.
Helper class to facilitate I/O.
Proxy around an arbitrary container, which implements basic functionality and iteration.
EnvironBase_t * fEnv
Address of the currently proxied object.
Sizing_t fDestruct
Container accessors: block destruct.
virtual ~TGenCollectionStreamer()
bool * getaddress< bool >(TGenCollectionProxy::StreamHelper &itm)
Int_t * getaddress< Int_t >(TGenCollectionProxy::StreamHelper &itm)
TObject * At(Int_t idx) const
Double_t * getaddress< Double_t >(TGenCollectionProxy::StreamHelper &itm)
TStreamerInfoActions::TActionSequence * GetReadObjectWiseActions()
void ReadObjects(int nElements, TBuffer &b, const TClass *onfileClass)
Abstract Interface class describing Streamer information for one class.
const std::type_info & Info_t
void ReadMapHelper(StreamHelper *i, Value *v, Bool_t vsn3, TBuffer &b)
void DispatchConvertBufferVectorPrimitives(TBuffer &b, void *obj, Int_t nElements, const TVirtualCollectionProxy *onfileProxy)
void ConvertArray(TGenCollectionProxy::StreamHelper *read, TGenCollectionProxy::StreamHelper *write, int nElements)
virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)=0
Small helper to describe the Value_type or the key_type of an STL container.
void read_tstring_pointer(Bool_t vsn3, TBuffer &b)
Value * fVal
Descriptor of the Value_type.
virtual TVirtualCollectionProxy * Generate() const
Virtual copy constructor.
EReadWrite
EReadWrite Enumerator Enum Constant Description kBase Base class element kOffsetL Fixed size array k...