23 #include "TClassEdit.h" 38 # define INLINE_TEMPLATE_ARGS 40 # define INLINE_TEMPLATE_ARGS inline 46 template <
typename From>
47 struct WithFactorMarker {
51 template <
typename From>
52 struct NoFactorMarker {
73 if (fConfiguration) fConfiguration->PrintDebug(buf,addr);
85 printf(
"StreamerInfoAction, class:%s, name=%s, fType[%d]=%d," 86 " %s, offset=%d (%s)\n",
88 aElement->
ClassName(), fOffset, sequenceType.Data());
102 printf(
"StreamerInfoAction, class:%s, name=%s, fType[%d]=%d," 103 " %s, bufpos=%d, arr=%p, offset=%d (%s)\n",
105 aElement->
ClassName(), buf.
Length(), addr, fOffset, sequenceType.Data());
113 printf(
"TLoopConfiguration: unconfigured\n");
122 void PrintDebug(
TBuffer &,
void *)
const {
138 void PrintDebug(
TBuffer &,
void *)
const {
141 TString sequenceType;
144 printf(
"StreamerInfoAction, class:%s, name=%s, fType[%d]=%d," 145 " %s, offset=%d (%s)\n",
147 aElement->
ClassName(), fOffset, sequenceType.Data());
165 char *obj = (
char*)addr;
166 TGenericConfiguration *conf = (TGenericConfiguration*)config;
172 char *obj = (
char*)addr;
173 TGenericConfiguration *conf = (TGenericConfiguration*)config;
174 return ((
TStreamerInfo*)conf->fInfo)->WriteBufferAux(buf, &obj, &(conf->fCompInfo), 0, 1, 1, config->
fOffset, 2);
177 template <
typename T>
180 T *
x = (
T*)( ((
char*)addr) + config->
fOffset );
187 TBitsConfiguration *conf = (TBitsConfiguration*)config;
199 uid = ( obj->
GetUniqueID() & 0xffffff) + (gpid<<24);
220 template <
typename T>
223 T *
x = (
T*)( ((
char*)addr) + config->
fOffset );
234 TConfWithFactor(
TVirtualStreamerInfo *info,
UInt_t id, TCompInfo_t *compinfo,
Int_t offset,
Double_t factor,
Double_t xmin) :
TConfiguration(info,
id,compinfo,offset),fFactor(factor),fXmin(xmin) {};
238 template <
typename T>
244 TConfWithFactor *conf = (TConfWithFactor *)config;
257 template <
typename T>
262 TConfNoFactor *conf = (TConfNoFactor *)config;
263 Int_t nbits = conf->fNbits;
275 ((TString*)(((
char*)addr)+config->
fOffset))->TString::Streamer(buf);
285 ((
TObject*)(((
char*)addr)+config->
fOffset))->TObject::Streamer(buf);
318 const char *fTypeName;
327 TConfiguration(info,
id,compinfo,offset,length), fOldClass(oldClass), fNewClass(oldClass), fStreamer(0), fTypeName(type_name), fIsSTLBase(isbase),
328 fCreateIterators(0), fCopyIterator(0), fDeleteIterator(0), fDeleteTwoIterators(0) { Init(); }
331 TConfiguration(info,
id,compinfo,offset,length), fOldClass(oldClass), fNewClass(newClass), fStreamer(0), fTypeName(type_name), fIsSTLBase(isbase),
332 fCreateIterators(0), fCopyIterator(0), fDeleteIterator(0), fDeleteTwoIterators(0) { Init(); }
335 TConfiguration(info,
id,compinfo,offset,length), fOldClass(oldClass), fNewClass(oldClass), fStreamer(streamer), fTypeName(type_name), fIsSTLBase(isbase),
336 fCreateIterators(0), fCopyIterator(0), fDeleteIterator(0), fDeleteTwoIterators(0) { Init(); }
339 TConfiguration(info,
id,compinfo,offset,length), fOldClass(oldClass), fNewClass(newClass), fStreamer(streamer), fTypeName(type_name), fIsSTLBase(isbase),
340 fCreateIterators(0), fCopyIterator(0), fDeleteIterator(0), fDeleteTwoIterators(0) { Init(); }
345 class TConfSTLWithFactor :
public TConfigSTL {
350 TConfSTLWithFactor(TConfigSTL *orig,
Double_t factor,
Double_t xmin) : TConfigSTL(*orig),fFactor(factor),fXmin(xmin) {};
354 class TConfSTLNoFactor :
public TConfigSTL {
358 TConfSTLNoFactor(TConfigSTL *orig,
Int_t nbits) : TConfigSTL(*orig),fNbits(nbits) {};
370 virtual ~TVectorLoopConfig() {};
373 printf(
"TVectorLoopConfig: increment=%ld\n",fIncrement);
376 void* GetFirstAddress(
void *start,
const void * )
const 394 virtual ~TAssocLoopConfig() {};
401 void* GetFirstAddress(
void *start,
const void * )
const 421 if (fProxy->HasPointers()) {
426 fNext = fProxy->GetFunctionNext(read);
427 fCopyIterator = fProxy->GetFunctionCopyIterator(read);
428 fDeleteIterator = fProxy->GetFunctionDeleteIterator(read);
442 virtual ~TGenericLoopConfig() {};
449 void* GetFirstAddress(
void *start_collection,
const void *end_collection)
const 454 void *iter = fCopyIterator(&iterator,start_collection);
455 void *arr0 = fNext(iter,end_collection);
456 if (iter != &iterator[0]) {
457 fDeleteIterator(iter);
467 TConfigSTL *config = (TConfigSTL*)conf;
472 TClass *oldClass = config->fOldClass;
485 void* alternative = oldProxy->
Allocate(nobjects,
true);
491 void *begin = &(startbuf[0]);
492 void *end = &(endbuf[0]);
493 config->fCreateIterators(alternative, &begin, &end, oldProxy);
497 if (begin != &(startbuf[0])) {
499 config->fDeleteTwoIterators(begin,end);
502 oldProxy->
Commit(alternative);
506 TClass *oldClass = config->fOldClass;
517 void* env = oldProxy->
Allocate(nobjects,
true);
519 if (nobjects || vers < 7 ) {
533 TConfigSTL *config = (TConfigSTL*)conf;
538 TClass *oldClass = config->fOldClass;
550 int objectSize = oldClass->
Size();
551 char *obj = (
char*)addr;
552 char *endobj = obj + conf->
fLength*objectSize;
554 for(; obj<endobj; obj+=objectSize) {
558 void* alternative = oldProxy->
Allocate(nobjects,
true);
562 void *begin = &(startbuf[0]);
563 void *end = &(endbuf[0]);
564 config->fCreateIterators(alternative, &begin, &end, oldProxy);
568 if (begin != &(startbuf[0])) {
570 config->fDeleteTwoIterators(begin,end);
573 oldProxy->
Commit(alternative);
578 TClass *oldClass = config->fOldClass;
586 int objectSize = oldClass->
Size();
587 char *obj = (
char*)addr;
588 char *endobj = obj + conf->
fLength*objectSize;
590 for(; obj<endobj; obj+=objectSize) {
594 void* env = oldProxy->
Allocate(nobjects,
true);
596 if (nobjects || vers < 7 ) {
611 TConfigSTL *config = (TConfigSTL*)conf;
615 TClass *newClass = config->fNewClass;
616 TClass *oldClass = config->fOldClass;
619 Error(
"ReadSTLMemberWiseChangedClass",
"Unfortunately, version %d of TStreamerInfo (used in %s) did not record enough information to convert a %s into a %s.",
631 void* alternative = newProxy->
Allocate(nobjects,
true);
636 void *begin = &(startbuf[0]);
637 void *end = &(endbuf[0]);
638 config->fCreateIterators( alternative, &begin, &end, newProxy);
642 if (begin != &(startbuf[0])) {
644 config->fDeleteTwoIterators(begin,end);
647 newProxy->
Commit(alternative);
655 TConfigSTL *config = (TConfigSTL*)conf;
659 TClass *newClass = config->fNewClass;
660 TClass *oldClass = config->fOldClass;
663 Error(
"ReadSTLMemberWiseChangedClass",
"Unfortunately, version %d of TStreamerInfo (used in %s) did not record enough information to convert a %s into a %s.",
672 int objectSize = newClass->
Size();
673 char *obj = (
char*)addr;
674 char *endobj = obj + conf->
fLength*objectSize;
676 for(; obj<endobj; obj+=objectSize) {
680 void* alternative = newProxy->
Allocate(nobjects,
true);
685 void *begin = &(startbuf[0]);
686 void *end = &(endbuf[0]);
687 config->fCreateIterators( alternative, &begin, &end, newProxy);
691 if (begin != &(startbuf[0])) {
693 config->fDeleteTwoIterators(begin,end);
696 newProxy->
Commit(alternative);
704 TConfigSTL *config = (TConfigSTL*)conf;
710 TConfigSTL *config = (TConfigSTL*)conf;
711 (*config->fStreamer)(buf,addr,conf->
fLength);
717 TConfigSTL *config = (TConfigSTL*)conf;
720 if (config->fIsSTLBase || vers == 0) {
730 TConfigSTL *config = (TConfigSTL*)conf;
733 if (config->fIsSTLBase || vers == 0) {
736 (*config->fStreamer)(buf,addr,conf->
fLength);
743 TConfigSTL *config = (TConfigSTL*)conf;
745 Version_t vers = buf.
ReadVersion(&start, &count, config->fOldClass);
747 memberwise(buf,((
char*)addr)+config->fOffset,config, vers);
749 objectwise(buf,((
char*)addr)+config->fOffset,config, vers, start);
755 template <
typename From,
typename To>
756 struct ConvertBasicType {
762 *(To*)( ((
char*)addr) + config->
fOffset ) = (To)temp;
767 template <
typename To>
768 struct ConvertBasicType<BitsMarker,To> {
779 *(To*)( ((
char*)addr) + config->
fOffset ) = (To)temp;
784 template <
typename From,
typename To>
785 struct ConvertBasicType<WithFactorMarker<From>,To> {
789 TConfWithFactor *conf = (TConfWithFactor *)config;
792 *(To*)( ((
char*)addr) + config->
fOffset ) = (To)temp;
797 template <
typename From,
typename To>
798 struct ConvertBasicType<NoFactorMarker<From>,To> {
802 TConfNoFactor *conf = (TConfNoFactor *)config;
805 *(To*)( ((
char*)addr) + config->
fOffset ) = (To)temp;
810 class TConfigurationUseCache :
public TConfiguration {
818 virtual void PrintDebug(
TBuffer &
b,
void *addr)
const 824 fprintf(stdout,
"StreamerInfoAction, class:%s, name=%s, fType[%d]=%d," 825 " %s, bufpos=%d, arr=%p, eoffset=%d, Redirect=%p\n",
831 virtual ~TConfigurationUseCache() {};
832 virtual TConfiguration *
Copy() {
833 TConfigurationUseCache *copy =
new TConfigurationUseCache(*
this);
842 TConfigurationUseCache *config = (TConfigurationUseCache*)conf;
849 Warning(
"ReadBuffer",
"Skipping %s::%s because the cache is missing.",info->
GetName(),aElement->
GetName());
850 char *ptr = (
char*)addr;
853 config->fAction(b, (*cached)[0]);
856 if (config->fNeedRepeat) {
864 TConfigurationUseCache *config = (TConfigurationUseCache*)conf;
871 Warning(
"ReadBuffer",
"Skipping %s::%s because the cache is missing.",info->
GetName(),aElement->
GetName());
872 char *ptr = (
char*)start;
873 UInt_t n = (((
void**)end)-((
void**)start));
877 void *cached_start = (*cached)[0];
878 void *cached_end = ((
char*)cached_start) + cached->
fSize * cached_config.fIncrement;
879 config->fAction(b,cached_start,cached_end,&cached_config);
882 if (config->fNeedRepeat) {
890 TConfigurationUseCache *config = (TConfigurationUseCache*)conf;
897 Warning(
"ReadBuffer",
"Skipping %s::%s because the cache is missing.",info->
GetName(),aElement->
GetName());
898 char *ptr = (
char*)start;
899 UInt_t n = (((
char*)end)-((
char*)start))/((TVectorLoopConfig*)loopconf)->fIncrement;
903 void *cached_start = (*cached)[0];
904 void *cached_end = ((
char*)cached_start) + cached->
fSize * cached_config.fIncrement;
905 config->fAction(b,cached_start,cached_end,&cached_config);
908 if (config->fNeedRepeat) {
916 TConfigurationUseCache *config = (TConfigurationUseCache*)conf;
925 Warning(
"ReadBuffer",
"Skipping %s::%s because the cache is missing.",info->
GetName(),aElement->
GetName());
930 void *cached_start = (*cached)[0];
931 void *cached_end = ((
char*)cached_start) + cached->
fSize * cached_config.fIncrement;
932 config->fAction(b,cached_start,cached_end,&cached_config);
935 if (config->fNeedRepeat) {
972 struct VectorLooper {
974 template <
typename T>
977 const Int_t incr = ((TVectorLoopConfig*)loopconfig)->fIncrement;
978 iter = (
char*)iter + config->
fOffset;
979 end = (
char*)end + config->
fOffset;
980 for(; iter != end; iter = (
char*)iter + incr ) {
981 T *
x = (
T*) ((
char*) iter);
987 template <
typename From,
typename To>
988 struct ConvertBasicType {
993 const Int_t incr = ((TVectorLoopConfig*)loopconfig)->fIncrement;
994 iter = (
char*)iter + config->
fOffset;
995 end = (
char*)end + config->
fOffset;
996 for(; iter != end; iter = (
char*)iter + incr ) {
998 *(To*)( ((
char*)iter) ) = (To)temp;
1004 template <
typename To>
1005 struct ConvertBasicType<BitsMarker,To> {
1010 const Int_t incr = ((TVectorLoopConfig*)loopconfig)->fIncrement;
1011 iter = (
char*)iter + config->
fOffset;
1012 end = (
char*)end + config->
fOffset;
1013 for(; iter != end; iter = (
char*)iter + incr ) {
1020 *(To*)( ((
char*)iter) ) = (To)temp;
1026 template <
typename From,
typename To>
1027 struct ConvertBasicType<WithFactorMarker<From>,To> {
1031 TConfWithFactor *conf = (TConfWithFactor *)config;
1033 const Int_t incr = ((TVectorLoopConfig*)loopconfig)->fIncrement;
1034 iter = (
char*)iter + config->
fOffset;
1035 end = (
char*)end + config->
fOffset;
1036 for(; iter != end; iter = (
char*)iter + incr ) {
1038 *(To*)( ((
char*)iter) ) = (To)temp;
1044 template <
typename From,
typename To>
1045 struct ConvertBasicType<NoFactorMarker<From>,To> {
1049 TConfNoFactor *conf = (TConfNoFactor *)config;
1051 const Int_t incr = ((TVectorLoopConfig*)loopconfig)->fIncrement;
1052 iter = (
char*)iter + config->
fOffset;
1053 end = (
char*)end + config->
fOffset;
1054 for(; iter != end; iter = (
char*)iter + incr ) {
1056 *(To*)( ((
char*)iter) ) = (To)temp;
1062 template <
typename T>
1065 const Int_t incr = ((TVectorLoopConfig*)loopconfig)->fIncrement;
1066 iter = (
char*)iter + config->
fOffset;
1067 end = (
char*)end + config->
fOffset;
1068 for(; iter != end; iter = (
char*)iter + incr ) {
1069 T *
x = (
T*) ((
char*) iter);
1075 template <Int_t (*iter_action)(TBuffer&,
void *,const TConfiguration*)>
1078 const Int_t incr = ((TVectorLoopConfig*)loopconfig)->fIncrement;
1081 for(
void *iter = start; iter != end; iter = (
char*)iter + incr ) {
1082 iter_action(buf, iter, config);
1092 UInt_t incr = ((TVectorLoopConfig*)loopconfig)->fIncrement;
1093 UInt_t n = (((
char*)end)-((
char*)start))/incr;
1094 char **arrptr =
new char*[
n];
1096 for(
void *iter = start; iter != end; iter = (
char*)iter + incr, ++i ) {
1097 arrptr[i] = (
char*)iter;
1129 UInt_t incr = ((TVectorLoopConfig*)loopconfig)->fIncrement;
1130 UInt_t n = (((
char*)end)-((
char*)start))/incr;
1131 char **arrptr =
new char*[
n];
1133 for(
void *iter = start; iter != end; iter = (
char*)iter + incr, ++i ) {
1134 arrptr[i] = (
char*)iter;
1145 UInt_t incr = ((TVectorLoopConfig*)loopconfig)->fIncrement;
1146 UInt_t n = (((
char*)end)-((
char*)start))/incr;
1147 char **arrptr =
new char*[
n];
1149 for(
void *iter = start; iter != end; iter = (
char*)iter + incr, ++i ) {
1150 arrptr[i] = (
char*)iter;
1157 template <
typename T>
1162 TConfigSTL *config = (TConfigSTL*)conf;
1164 buf.
ReadVersion(&start, &count, config->fOldClass);
1166 std::vector<T> *
const vec = (std::vector<T>*)(((
char*)addr)+config->fOffset);
1169 vec->resize(nvalues);
1171 #ifdef R__VISUAL_CPLUSPLUS 1177 T *begin = &(*vec->begin());
1188 TConfigSTL *config = (TConfigSTL*)conf;
1190 buf.
ReadVersion(&start, &count, config->fOldClass);
1192 std::vector<bool> *
const vec = (std::vector<bool>*)(((
char*)addr)+config->fOffset);
1195 vec->resize(nvalues);
1197 bool *items =
new bool[nvalues];
1199 for(
Int_t i = 0 ; i < nvalues; ++i) {
1200 (*vec)[i] = items[i];
1219 TConfigSTL *config = (TConfigSTL*)conf;
1221 buf.
ReadVersion(&start, &count, config->fOldClass);
1223 std::vector<float> *
const vec = (std::vector<float>*)(((
char*)addr)+config->fOffset);
1226 vec->resize(nvalues);
1228 #ifdef R__VISUAL_CPLUSPLUS 1234 float *begin = &(*vec->begin());
1245 TConfigSTL *config = (TConfigSTL*)conf;
1247 buf.
ReadVersion(&start, &count, config->fOldClass);
1249 std::vector<double> *
const vec = (std::vector<double>*)(((
char*)addr)+config->fOffset);
1252 vec->resize(nvalues);
1254 #ifdef R__VISUAL_CPLUSPLUS 1260 double *begin = &(*vec->begin());
1267 template <
typename From,
typename To>
1268 struct ConvertCollectionBasicType {
1273 TConfigSTL *config = (TConfigSTL*)conf;
1275 buf.
ReadVersion(&start, &count, config->fOldClass);
1277 std::vector<To> *
const vec = (std::vector<To>*)(((
char*)addr)+config->fOffset);
1280 vec->resize(nvalues);
1282 From *temp =
new From[nvalues];
1284 for(
Int_t ind = 0; ind < nvalues; ++ind) {
1285 (*vec)[ind] = (To)temp[ind];
1294 template <
typename From,
typename To>
1295 struct ConvertCollectionBasicType<NoFactorMarker<From>,To> {
1300 TConfigSTL *config = (TConfigSTL*)conf;
1302 buf.
ReadVersion(&start, &count, config->fOldClass);
1304 std::vector<To> *
const vec = (std::vector<To>*)(((
char*)addr)+config->fOffset);
1307 vec->resize(nvalues);
1309 From *temp =
new From[nvalues];
1311 for(
Int_t ind = 0; ind < nvalues; ++ind) {
1312 (*vec)[ind] = (To)temp[ind];
1321 template <
typename To>
1326 TConfigSTL *config = (TConfigSTL*)conf;
1328 buf.
ReadVersion(&start, &count, config->fOldClass);
1330 std::vector<To> *
const vec = (std::vector<To>*)(((
char*)addr)+config->fOffset);
1333 vec->resize(nvalues);
1337 for(
Int_t ind = 0; ind < nvalues; ++ind) {
1338 (*vec)[ind] = (To)temp[ind];
1348 struct VectorPtrLooper {
1350 template <
typename T>
1355 for(; iter != end; iter = (
char*)iter +
sizeof(
void*) ) {
1356 T *
x = (
T*)( ((
char*) (*(
void**)iter) ) + offset );
1362 template <
typename From,
typename To>
1363 struct ConvertBasicType {
1369 for(; iter != end; iter = (
char*)iter +
sizeof(
void*) ) {
1371 To *
x = (To*)( ((
char*) (*(
void**)iter) ) + offset );
1378 template <
typename To>
1379 struct ConvertBasicType<BitsMarker,To> {
1385 for(; iter != end; iter = (
char*)iter +
sizeof(
void*) ) {
1392 To *
x = (To*)( ((
char*) (*(
void**)iter) ) + offset );
1399 template <
typename From,
typename To>
1400 struct ConvertBasicType<WithFactorMarker<From>,To> {
1404 TConfWithFactor *conf = (TConfWithFactor *)config;
1407 for(; iter != end; iter = (
char*)iter +
sizeof(
void*) ) {
1409 To *
x = (To*)( ((
char*) (*(
void**)iter) ) + offset );
1416 template <
typename From,
typename To>
1417 struct ConvertBasicType<NoFactorMarker<From>,To> {
1421 TConfNoFactor *conf = (TConfNoFactor *)config;
1424 for(; iter != end; iter = (
char*)iter +
sizeof(
void*) ) {
1426 To *
x = (To*)( ((
char*) (*(
void**)iter) ) + offset );
1433 template <
typename T>
1438 for(; iter != end; iter = (
char*)iter +
sizeof(
void*) ) {
1439 T *
x = (
T*)( ((
char*) (*(
void**)iter) ) + offset );
1445 template <Int_t (*action)(TBuffer&,
void *,const TConfiguration*)>
1448 for(
void *iter = start; iter != end; iter = (
char*)iter +
sizeof(
void*) ) {
1449 action(buf, *(
void**)iter, config);
1459 return GenericRead(buf,start,end,config);
1464 Int_t n = ( ((
void**)end) - ((
void**)iter) );
1465 char **arr = (
char**)iter;
1471 Int_t n = ( ((
void**)end) - ((
void**)iter) );
1472 char **arr = (
char**)iter;
1478 struct AssociativeLooper {
1480 template <
typename T>
1496 template <
typename T,
void (*action)(TBuffer&,
void *,Int_t)>
1501 TConfigSTL *config = (TConfigSTL*)conf;
1503 buf.
ReadVersion(&start, &count, config->fOldClass);
1505 TClass *newClass = config->fNewClass;
1511 void* alternative = newProxy->
Allocate(nvalues,
true);
1515 void *begin = &(startbuf[0]);
1516 void *end = &(endbuf[0]);
1517 config->fCreateIterators(alternative, &begin, &end, newProxy);
1521 action(buf,begin,nvalues);
1523 if (begin != &(startbuf[0])) {
1525 config->fDeleteTwoIterators(begin,end);
1528 newProxy->
Commit(alternative);
1536 return ReadNumericalCollection<bool,SimpleRead<bool> >(buf,addr,conf);
1541 return ReadNumericalCollection<Float_t,SimpleReadFloat16 >(buf,addr,conf);
1546 return ReadNumericalCollection<Double_t,SimpleReadDouble32 >(buf,addr,conf);
1549 template <
typename T>
1552 return ReadNumericalCollection<T,SimpleRead<T> >(buf,addr,conf);
1555 template <
typename From,
typename To>
1556 struct ConvertRead {
1559 From *temp =
new From[nvalues];
1561 To *vec = (To*)addr;
1562 for(
Int_t ind = 0; ind < nvalues; ++ind) {
1563 vec[ind] = (To)temp[ind];
1569 template <
typename From,
typename To>
1570 struct ConvertRead<NoFactorMarker<From>,To> {
1573 From *temp =
new From[nvalues];
1575 To *vec = (To*)addr;
1576 for(
Int_t ind = 0; ind < nvalues; ++ind) {
1577 vec[ind] = (To)temp[ind];
1583 template <
typename From,
typename To>
1584 struct ConvertRead<WithFactorMarker<From>,To> {
1587 From *temp =
new From[nvalues];
1590 To *vec = (To*)addr;
1591 for(
Int_t ind = 0; ind < nvalues; ++ind) {
1592 vec[ind] = (To)temp[ind];
1598 template <
typename From,
typename To>
1599 struct ConvertCollectionBasicType {
1602 return ReadNumericalCollection<To,ConvertRead<From,To>::Action >(buf,addr,conf);
1608 struct GenericLooper {
1610 template <
typename T>
1613 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1615 Next_t next = loopconfig->fNext;
1619 void *iter = loopconfig->fCopyIterator(iterator,start);
1621 while( (addr = next(iter,end)) ) {
1622 T *
x = (
T*)( ((
char*)addr) + offset );
1625 if (iter != &iterator[0]) {
1626 loopconfig->fDeleteIterator(iter);
1631 template <
typename T>
1634 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1636 Next_t next = loopconfig->fNext;
1640 void *iter = loopconfig->fCopyIterator(iterator,start);
1642 while( (addr = next(iter,end)) ) {
1643 T *
x = (
T*)( ((
char*)addr) + offset );
1646 if (iter != &iterator[0]) {
1647 loopconfig->fDeleteIterator(iter);
1652 template <Int_t (*iter_action)(TBuffer&,
void *,const TConfiguration*)>
1655 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1658 Next_t next = loopconfig->fNext;
1661 void *iter = loopconfig->fCopyIterator(&iterator,start);
1663 while( (addr = next(iter,end)) ) {
1664 iter_action(buf, addr, config);
1666 if (iter != &iterator[0]) {
1667 loopconfig->fDeleteIterator(iter);
1672 template <
typename From,
typename To>
1674 static void ConvertAction(From *items,
void *start,
const void *end,
const TLoopConfiguration *loopconf,
const TConfiguration *config)
1676 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1679 Next_t next = loopconfig->fNext;
1682 void *iter = loopconfig->fCopyIterator(&iterator,start);
1684 while( (addr = next(iter,end)) ) {
1685 To *
x = (To*)( ((
char*)addr) + offset );
1689 if (iter != &iterator[0]) {
1690 loopconfig->fDeleteIterator(iter);
1695 template <
typename From,
typename To>
1697 static void ConvertAction(From *items,
void *start,
const void *end,
const TLoopConfiguration *loopconf,
const TConfiguration * )
1702 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1703 Next_t next = loopconfig->fNext;
1707 while( (addr = next(iter,end)) ) {
1708 To *
x = (To*)(addr);
1715 template <
typename From,
typename To,
template <
typename F,
typename T>
class Converter = Generic >
1716 struct ConvertBasicType {
1721 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1725 From *items =
new From[nvalues];
1727 Converter<From,To>::ConvertAction(items,start,end,loopconfig,config);
1733 template <
typename To>
1734 struct ConvertBasicType<BitsMarker, To, Generic> {
1739 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1744 UInt_t *items = items_storage;
1747 Next_t next = loopconfig->fNext;
1750 void *iter = loopconfig->fCopyIterator(&iterator,start);
1752 while( (addr = next(iter,end)) ) {
1757 To *
x = (To*)( ((
char*)addr) + offset );
1761 if (iter != &iterator[0]) {
1762 loopconfig->fDeleteIterator(iter);
1765 delete [] items_storage;
1770 template <
typename From,
typename To,
template <
typename F,
typename T>
class Converter >
1771 struct ConvertBasicType<WithFactorMarker<From>,To,Converter > {
1776 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1780 TConfSTLWithFactor *conf = (TConfSTLWithFactor *)config;
1782 From *items =
new From[nvalues];
1784 Converter<From,To>::ConvertAction(items,start,end,loopconfig,config);
1790 template <
typename From,
typename To,
template <
typename F,
typename T>
class Converter >
1791 struct ConvertBasicType<NoFactorMarker<From>,To,Converter > {
1796 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1800 TConfSTLNoFactor *conf = (TConfSTLNoFactor *)config;
1802 From *items =
new From[nvalues];
1804 Converter<From,To>::ConvertAction(items,start,end,loopconfig,config);
1815 return GenericRead(buf,start,end,loopconfig, config);
1820 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1827 TGenericLoopConfig *loopconfig = (TGenericLoopConfig*)loopconf;
1832 template <
typename T>
1851 template <
typename ActionHolder>
1856 TConfigSTL *config = (TConfigSTL*)conf;
1858 buf.
ReadVersion(&start, &count, config->fOldClass);
1860 TClass *newClass = config->fNewClass;
1866 void* alternative = newProxy->
Allocate(nvalues,
true);
1870 void *begin = &(startbuf[0]);
1871 void *end = &(endbuf[0]);
1872 config->fCreateIterators(alternative, &begin, &end, newProxy);
1876 TGenericLoopConfig loopconf(newProxy,
kTRUE);
1877 ActionHolder::Action(buf,begin,end,&loopconf,config);
1879 if (begin != &(startbuf[0])) {
1881 config->fDeleteTwoIterators(begin,end);
1884 newProxy->
Commit(alternative);
1892 return ReadNumericalCollection<ConvertBasicType<bool,bool,Numeric > >(buf,addr,conf);
1897 return ReadNumericalCollection<ConvertBasicType<NoFactorMarker<float>,float,Numeric > >(buf,addr,conf);
1902 return ReadNumericalCollection<ConvertBasicType<float,double,Numeric > >(buf,addr,conf);
1907 template <
typename T>
1910 return ReadNumericalCollection<ConvertBasicType<T,T,Numeric > >(buf,addr,conf);
1913 template <
typename From,
typename To>
1914 struct ConvertCollectionBasicType {
1918 return ReadNumericalCollection<ConvertBasicType<From,To,Numeric > >(buf,addr,conf);
1925 template <
typename Looper,
typename From>
1953 template <
class Looper>
1973 case TStreamerInfo::kBits:
Error(
"GetNumericCollectionReadAction",
"There is no support for kBits outside of a TObject.");
break;
1975 TConfigSTL *alternate =
new TConfSTLNoFactor(conf,12);
1988 TConfigSTL *alternate =
new TConfSTLNoFactor(conf,0);
2004 Fatal(
"GetNumericCollectionReadAction",
"Is confused about %d",type);
2009 template <
typename Looper,
typename From>
2036 template <
typename Looper>
2041 return GetConvertCollectionReadActionFrom<Looper,Bool_t>(newtype, conf );
2044 return GetConvertCollectionReadActionFrom<Looper,Char_t>(newtype, conf );
2047 return GetConvertCollectionReadActionFrom<Looper,Short_t>(newtype, conf );
2050 return GetConvertCollectionReadActionFrom<Looper,Int_t>(newtype, conf );
2053 return GetConvertCollectionReadActionFrom<Looper,Long_t>(newtype, conf );
2056 return GetConvertCollectionReadActionFrom<Looper,Long64_t>(newtype, conf );
2059 return GetConvertCollectionReadActionFrom<Looper,Float_t>( newtype, conf );
2062 return GetConvertCollectionReadActionFrom<Looper,Double_t>(newtype, conf );
2065 return GetConvertCollectionReadActionFrom<Looper,UChar_t>(newtype, conf );
2068 return GetConvertCollectionReadActionFrom<Looper,UShort_t>(newtype, conf );
2071 return GetConvertCollectionReadActionFrom<Looper,UInt_t>(newtype, conf );
2074 return GetConvertCollectionReadActionFrom<Looper,ULong_t>(newtype, conf );
2077 return GetConvertCollectionReadActionFrom<Looper,ULong64_t>(newtype, conf );
2080 return GetConvertCollectionReadActionFrom<Looper,NoFactorMarker<Float16_t> >( newtype, conf );
2083 return GetConvertCollectionReadActionFrom<Looper,NoFactorMarker<Double32_t> >( newtype, conf );
2086 Error(
"GetConvertCollectionReadAction",
"There is no support for kBits outside of a TObject.");
2095 template <
class Looper>
2116 return TConfiguredAction( Looper::template ReadAction<ReadBasicType_WithFactor<float> >,
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
2119 if (!nbits) nbits = 12;
2120 return TConfiguredAction( Looper::template ReadAction<ReadBasicType_NoFactor<float> >,
new TConfNoFactor(info,i,compinfo,offset,nbits) );
2126 return TConfiguredAction( Looper::template ReadAction<ReadBasicType_WithFactor<double> >,
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
2130 return TConfiguredAction( Looper::template ReadAction<ConvertBasicType<float,double>::Action >,
new TConfiguration(info,i,compinfo,offset) );
2132 return TConfiguredAction( Looper::template ReadAction<ReadBasicType_NoFactor<double> >,
new TConfNoFactor(info,i,compinfo,offset,nbits) );
2150 return GetCollectionReadConvertAction<Looper,Bool_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2153 return GetCollectionReadConvertAction<Looper,Char_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2156 return GetCollectionReadConvertAction<Looper,Short_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2159 return GetCollectionReadConvertAction<Looper,Int_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2162 return GetCollectionReadConvertAction<Looper,Long_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2165 return GetCollectionReadConvertAction<Looper,Long64_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2168 return GetCollectionReadConvertAction<Looper,Float_t>( element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2171 return GetCollectionReadConvertAction<Looper,Double_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2174 return GetCollectionReadConvertAction<Looper,UChar_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2177 return GetCollectionReadConvertAction<Looper,UShort_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2180 return GetCollectionReadConvertAction<Looper,UInt_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2183 return GetCollectionReadConvertAction<Looper,ULong_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2186 return GetCollectionReadConvertAction<Looper,ULong64_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2189 return GetCollectionReadConvertAction<Looper,BitsMarker>(element->
GetNewType(),
new TBitsConfiguration(info,i,compinfo,offset) );
2193 return GetCollectionReadConvertAction<Looper,WithFactorMarker<float> >(element->
GetNewType(),
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
2196 if (!nbits) nbits = 12;
2197 return GetCollectionReadConvertAction<Looper,NoFactorMarker<float> >(element->
GetNewType(),
new TConfNoFactor(info,i,compinfo,offset,nbits) );
2203 return GetCollectionReadConvertAction<Looper,WithFactorMarker<double> >(element->
GetNewType(),
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
2207 return GetCollectionReadConvertAction<Looper,Float_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2209 return GetCollectionReadConvertAction<Looper,NoFactorMarker<double> >(element->
GetNewType(),
new TConfNoFactor(info,i,compinfo,offset,nbits) );
2215 return TConfiguredAction( Looper::GenericRead,
new TGenericConfiguration(info,i,compinfo) );
2222 template <
class Looper>
2241 return TConfiguredAction( Looper::GenericWrite,
new TConfiguration(info,i,compinfo,0 ) );
2270 if (fNumber >= infos->
GetSize()) {
2273 if (!infos->
At(fNumber)) {
2274 infos->
AddAt(
this, fNumber);
2278 assert(fComp == 0 && fCompFull == 0 && fCompOpt == 0);
2284 if (fReadObjectWise) fReadObjectWise->fActions.clear();
2287 if (fWriteObjectWise) fWriteObjectWise->fActions.clear();
2290 if (fReadMemberWise) fReadMemberWise->fActions.clear();
2293 if (fWriteMemberWise) fWriteMemberWise->fActions.clear();
2296 if (fReadMemberWiseVecPtr) fReadMemberWiseVecPtr->fActions.clear();
2299 if (fWriteMemberWiseVecPtr) fWriteMemberWiseVecPtr->fActions.clear();
2311 fCompOpt[0] = fCompFull[0] = &(fComp[0]);
2319 fNslots = ndata + ndata/2 + 1;
2331 if (!CanOptimize()) {
2332 SetBit(kCannotOptimize);
2338 for (i = 0; i <
ndata; ++i) {
2348 fComp[fNdata].fType = element->
GetType();
2349 fComp[fNdata].fNewType = element->
GetNewType();
2350 fComp[fNdata].fOffset = element->
GetOffset();
2352 fComp[fNdata].fElem = element;
2353 fComp[fNdata].fMethod = element->
GetMethod();
2360 if (!TestBit(kCannotOptimize)
2364 && (fComp[fNdata].
fType == fComp[fNdata].fNewType)
2365 && (fComp[keep].fMethod == 0)
2368 && (fComp[keep].
fType < kObject)
2371 && ((element->
GetOffset()-fComp[keep].fOffset) == (fComp[keep].fLength)*asize)
2372 && ((fOldVersion<6) || !previous ||
2383 if (!previousOptimized) {
2386 fComp[fNslots - (++optiOut) ] = fComp[keep];
2387 fCompFull[fNfulldata-1] = &(fComp[fNslots - optiOut]);
2389 fComp[fNslots - (++optiOut) ] = fComp[fNdata];
2390 fCompFull[fNfulldata] = &(fComp[fNslots - optiOut]);
2392 R__ASSERT( keep < (fNslots - optiOut) );
2394 if (fComp[keep].fLength == 0) {
2395 fComp[keep].fLength++;
2397 fComp[keep].fLength++;
2399 isOptimized =
kTRUE;
2400 previousOptimized =
kTRUE;
2401 }
else if (element->
GetType() < 0) {
2411 fComp[fNslots - (++optiOut) ] = fComp[fNdata];
2412 fCompFull[fNfulldata] = &(fComp[fNslots - optiOut]);
2414 previousOptimized =
kFALSE;
2417 if (fComp[fNdata].fNewType != fComp[fNdata].
fType) {
2418 if (fComp[fNdata].fNewType > 0) {
2419 if ( (fComp[fNdata].fNewType == kObjectp || fComp[fNdata].fNewType == kAnyp
2420 || fComp[fNdata].fNewType == kObject || fComp[fNdata].fNewType == kAny
2421 || fComp[fNdata].fNewType == kTObject || fComp[fNdata].fNewType == kTNamed || fComp[fNdata].fNewType == kTString)
2422 && (fComp[fNdata].fType == kObjectp || fComp[fNdata].fType == kAnyp
2423 || fComp[fNdata].fType == kObject || fComp[fNdata].fType == kAny
2424 || fComp[fNdata].fType == kTObject || fComp[fNdata].fType == kTNamed || fComp[fNdata].fType == kTString )
2426 fComp[fNdata].fType = fComp[fNdata].fNewType;
2427 }
else if (fComp[fNdata].fType !=
kCounter) {
2428 fComp[fNdata].fType += kConv;
2431 if (fComp[fNdata].fType ==
kCounter) {
2432 Warning(
"Compile",
"Counter %s should not be skipped from class %s", element->
GetName(),
GetName());
2434 fComp[fNdata].fType += kSkip;
2437 fCompOpt[fNdata] = &(fComp[fNdata]);
2438 fCompFull[fNfulldata] = &(fComp[fNdata]);
2440 R__ASSERT( fNdata < (fNslots - optiOut) );
2443 if (fComp[keep].fLength == 0) {
2444 fComp[keep].fLength = 1;
2447 previousOptimized =
kFALSE;
2457 for (i = 0; i < fNdata; ++i) {
2458 if (!fCompOpt[i]->fElem || fCompOpt[i]->fElem->GetType()< 0) {
2461 AddReadAction(fReadObjectWise, i, fCompOpt[i]);
2462 AddWriteAction(fWriteObjectWise, i, fCompOpt[i]);
2464 for (i = 0; i < fNfulldata; ++i) {
2465 if (!fCompFull[i]->fElem || fCompFull[i]->fElem->GetType()< 0) {
2468 AddReadAction(fReadMemberWise, i, fCompFull[i]);
2469 AddWriteAction(fWriteMemberWise, i, fCompFull[i]);
2470 AddReadMemberWiseVecPtrAction(fReadMemberWiseVecPtr, i, fCompFull[i]);
2471 AddWriteMemberWiseVecPtrAction(fWriteMemberWiseVecPtr, i, fCompFull[i]);
2475 fOptimized = isOptimized;
2483 template <
typename From>
2515 switch (compinfo->
fType) {
2533 readSequence->
AddAction( ReadBasicType_WithFactor<float>,
new TConfWithFactor(
this,i,compinfo,compinfo->
fOffset,element->
GetFactor(),element->
GetXmin()) );
2536 if (!nbits) nbits = 12;
2537 readSequence->
AddAction( ReadBasicType_NoFactor<float>,
new TConfNoFactor(
this,i,compinfo,compinfo->
fOffset,nbits) );
2543 readSequence->
AddAction( ReadBasicType_WithFactor<double>,
new TConfWithFactor(
this,i,compinfo,compinfo->
fOffset,element->
GetFactor(),element->
GetXmin()) );
2547 readSequence->
AddAction( ConvertBasicType<float,double>::Action,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2549 readSequence->
AddAction( ReadBasicType_NoFactor<double>,
new TConfNoFactor(
this,i,compinfo,compinfo->
fOffset,nbits) );
2566 if (newClass && newClass != oldClass) {
2568 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseChangedClass,ReadSTLObjectWiseStreamerV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2570 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseChangedClass,ReadSTLObjectWiseFastArrayV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetTypeName(),isSTLbase));
2574 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseSameClass,ReadSTLObjectWiseStreamerV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2576 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseSameClass,ReadSTLObjectWiseFastArrayV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,element->
GetTypeName(),isSTLbase));
2580 if (newClass && newClass != oldClass) {
2582 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseChangedClass,ReadSTLObjectWiseStreamer>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2585 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseChangedClass,ReadSTLObjectWiseFastArray>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetTypeName(),isSTLbase));
2589 readSequence->
AddAction(GetConvertCollectionReadAction<VectorLooper>(oldClass->
GetCollectionProxy()->
GetType(), newClass->
GetCollectionProxy()->
GetType(),
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetTypeName(),isSTLbase)));
2592 readSequence->
AddAction(GetConvertCollectionReadAction<AssociativeLooper>(oldClass->
GetCollectionProxy()->
GetType(), newClass->
GetCollectionProxy()->
GetType(),
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetTypeName(),isSTLbase)));
2598 readSequence->
AddAction(GetConvertCollectionReadAction<GenericLooper>(oldClass->
GetCollectionProxy()->
GetType(), newClass->
GetCollectionProxy()->
GetType(),
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetTypeName(),isSTLbase)));
2605 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseSameClass,ReadSTLObjectWiseStreamer>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2608 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseSameClass,ReadSTLObjectWiseFastArray>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,element->
GetTypeName(),isSTLbase));
2630 if (newClass && newClass != oldClass) {
2632 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseChangedClass,ReadSTLObjectWiseStreamerV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,newClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2634 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseChangedClass,ReadSTLObjectWiseFastArrayV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,newClass,element->
GetTypeName(),isSTLbase));
2638 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseSameClass,ReadSTLObjectWiseStreamerV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2640 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseSameClass,ReadSTLObjectWiseFastArrayV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,element->
GetTypeName(),isSTLbase));
2644 if (newClass && newClass != oldClass) {
2646 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseChangedClass,ReadSTLObjectWiseStreamer>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,newClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2648 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseChangedClass,ReadSTLObjectWiseFastArray>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,newClass,element->
GetTypeName(),isSTLbase));
2652 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseSameClass,ReadSTLObjectWiseStreamer>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2654 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseSameClass,ReadSTLObjectWiseFastArray>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,element->
GetTypeName(),isSTLbase));
2663 AddReadConvertAction<Bool_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2666 AddReadConvertAction<Char_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2669 AddReadConvertAction<Short_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2672 AddReadConvertAction<Int_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2675 AddReadConvertAction<Long_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2678 AddReadConvertAction<Long64_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2681 AddReadConvertAction<Float_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2684 AddReadConvertAction<Double_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2687 AddReadConvertAction<UChar_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2690 AddReadConvertAction<UShort_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2693 AddReadConvertAction<UInt_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2696 AddReadConvertAction<ULong_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2699 AddReadConvertAction<ULong64_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2702 AddReadConvertAction<BitsMarker>(readSequence, compinfo->
fNewType,
new TBitsConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2706 AddReadConvertAction<WithFactorMarker<float> >(readSequence, compinfo->
fNewType,
new TConfWithFactor(
this,i,compinfo,compinfo->
fOffset,element->
GetFactor(),element->
GetXmin()) );
2709 if (!nbits) nbits = 12;
2710 AddReadConvertAction<NoFactorMarker<float> >(readSequence, compinfo->
fNewType,
new TConfNoFactor(
this,i,compinfo,compinfo->
fOffset,nbits) );
2716 AddReadConvertAction<WithFactorMarker<double> >(readSequence, compinfo->
fNewType,
new TConfWithFactor(
this,i,compinfo,compinfo->
fOffset,element->
GetFactor(),element->
GetXmin()) );
2720 AddReadConvertAction<Float_t>(readSequence, compinfo->
fNewType,
new TConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2722 AddReadConvertAction<NoFactorMarker<double> >(readSequence, compinfo->
fNewType,
new TConfNoFactor(
this,i,compinfo,compinfo->
fOffset,nbits) );
2728 readSequence->AddAction(
GenericReadAction,
new TGenericConfiguration(
this,i,compinfo) );
2752 readSequence->
AddAction( GetCollectionReadAction<VectorPtrLooper>(
this,element,compinfo->
fType,i,compinfo,compinfo->
fOffset) );
2769 switch (compinfo->
fType) {
2853 #if defined(CDJ_NO_COMPILE) 2856 writeSequence->
fActions.pop_back();
2877 #if defined(CDJ_NO_COMPILE) 2882 writeSequence->Addaction( GetCollectionWriteAction<VectorPtrLooper>(
this,element,compinfo->
fType,i,compinfo,compinfo->
fOffset) );
2885 writeSequence->
AddAction( VectorPtrLooper::GenericWrite,
new TGenericConfiguration(
this,i,compinfo) );
2952 ::Warning(
"CreateReadMemberWiseActions",
"%s",
2967 if (newType != oldType) {
2985 TConfiguredAction action( GetCollectionReadAction<VectorLooper>(info,element,oldType,i,compinfo,offset) );
2988 sequence->
AddAction( GetCollectionReadAction<VectorLooper>(info,element,oldType,i,compinfo,offset));
2995 TConfiguredAction action( GetCollectionReadAction<VectorLooper>(info,element,oldType,i,compinfo,offset) );
2998 sequence->
AddAction( GetCollectionReadAction<GenericLooper>(info,element,oldType,i,compinfo,offset) );
3070 #if defined(CDJ_NO_COMPILE) 3073 if (newType != oldType) {
3089 TConfiguredAction action( GetCollectionWriteAction<VectorLooper>(info,element,oldType,i,compinfo,offset) );
3092 sequence->
AddAction(GetCollectionWriteAction<VectorLooper>(info,element,oldType,i,compinfo,offset));
3101 TConfiguredAction action( GetWriteAction<VectorLooper>(info,element,oldType,i,compinfo,offset) );
3122 sequence->
AddAction( GenericLooper<WriteBasicType_WithFactor<float> >,
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
3125 if (!nbits) nbits = 12;
3126 sequence->
AddAction( GenericLooper<WriteBasicType_NoFactor<float> >,
new TConfNoFactor(info,i,compinfo,offset,nbits) );
3132 sequence->
AddAction( GenericLooper<WriteBasicType_WithFactor<double> >,
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
3136 sequence->
AddAction( GenericLooper<ConvertBasicType<float,double> >,
new TConfiguration(info,i,compinfo,offset) );
3138 sequence->
AddAction( GenericLooper<WriteBasicType_NoFactor<double> >,
new TConfNoFactor(info,i,compinfo,offset,nbits) );
3159 sequence->
AddAction( GetCollectionWriteAction<VectorLooper>(info,element,oldType,i,compinfo,offset) );
3176 TStreamerInfoActions::ActionContainer_t::iterator end = fActions.end();
3177 for(TStreamerInfoActions::ActionContainer_t::iterator iter = fActions.begin();
3181 if (!iter->fConfiguration->fInfo->GetElements()->At(iter->fConfiguration->fElemId)->TestBit(
TStreamerElement::kCache))
3182 iter->fConfiguration->AddToOffset(delta);
3194 TStreamerInfoActions::ActionContainer_t::iterator end = fActions.end();
3195 for(TStreamerInfoActions::ActionContainer_t::iterator iter = fActions.begin();
3199 TConfiguration *conf = iter->fConfiguration->
Copy();
3200 sequence->
AddAction( iter->fAction, conf );
3214 for(
UInt_t id = 0;
id < element_ids.size(); ++id) {
3215 if ( element_ids[
id] < 0 ) {
3216 TStreamerInfoActions::ActionContainer_t::iterator end = fActions.end();
3217 for(TStreamerInfoActions::ActionContainer_t::iterator iter = fActions.begin();
3221 TConfiguration *conf = iter->fConfiguration->
Copy();
3222 if (!iter->fConfiguration->fInfo->GetElements()->At(iter->fConfiguration->fElemId)->TestBit(
TStreamerElement::kCache))
3224 sequence->
AddAction( iter->fAction, conf );
3227 TStreamerInfoActions::ActionContainer_t::iterator end = fActions.end();
3228 for(TStreamerInfoActions::ActionContainer_t::iterator iter = fActions.begin();
3231 if ( iter->fConfiguration->fElemId == (
UInt_t)element_ids[id] ) {
3232 TConfiguration *conf = iter->fConfiguration->
Copy();
3233 if (!iter->fConfiguration->fInfo->GetElements()->At(iter->fConfiguration->fElemId)->TestBit(
TStreamerElement::kCache))
3235 sequence->
AddAction( iter->fAction, conf );
3243 #if !defined(R__WIN32) && !defined(_AIX) 3252 #if defined(R__WIN32) || defined(__CYGWIN__) || defined(_AIX) 3253 return "not available on this platform";
3255 MEMORY_BASIC_INFORMATION mbi;
3256 if (!VirtualQuery (func, &mbi,
sizeof (mbi)))
3261 HMODULE hMod = (HMODULE) mbi.AllocationBase;
3262 static char moduleName[MAX_PATH];
3264 if (!GetModuleFileNameA (hMod, moduleName,
sizeof (moduleName)))
3272 if (dladdr((
void*)func,&info)==0) {
3274 return "name not found";
3277 return info.dli_sname;
3289 fLoopConfig->Print();
3291 TStreamerInfoActions::ActionContainer_t::const_iterator end = fActions.end();
3292 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = fActions.begin();
3296 iter->fConfiguration->Print();
3297 if (strstr(opt,
"func")) {
Describe Streamer information for one class version.
virtual const char * GetName() const
Returns name of object.
std::string GetName(const std::string &scope_name)
void SetBufferOffset(Int_t offset=0)
virtual Int_t GetCollectionType() const =0
virtual UInt_t GetUniqueID() const
Return the unique object id.
double read(const std::string &file_name)
reading
INLINE_TEMPLATE_ARGS Int_t ReadBasicType_WithFactor(TBuffer &buf, void *addr, const TConfiguration *config)
void PutObjectWithID(TObject *obj, UInt_t uid=0)
stores the object at the uid th slot in the table of objects The object uniqued is set as well as its...
Int_t ReadBufferSkip(TBuffer &b, const T &arrptr, const TCompInfo *compinfo, Int_t kase, TStreamerElement *aElement, Int_t narr, Int_t eoffset)
Skip an element.
virtual void * Allocate(UInt_t n, Bool_t forceDelete)=0
TVirtualStreamerInfo * fInfo
TStreamerInfo form which the action is derived.
static void AddReadConvertAction(TStreamerInfoActions::TActionSequence *sequence, Int_t newtype, TConfiguration *conf)
virtual void AddToOffset(Int_t delta)
static TConfiguredAction GetConvertCollectionReadActionFrom(Int_t newtype, TConfiguration *conf)
ActionContainer_t fActions
virtual TStreamerInfoActions::TActionSequence * GetReadMemberWiseActions(Int_t version)=0
virtual Int_t GetProperties() const
void AddReadMemberWiseVecPtrAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read action for the given element.
void Fatal(const char *location, const char *msgfmt,...)
INLINE_TEMPLATE_ARGS Int_t ReadSTL(TBuffer &buf, void *addr, const TConfiguration *conf)
TLoopConfiguration * fLoopConfig
If this is a bundle of memberwise streaming action, this configures the looping.
void AddReadAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read action for the given element.
Equal to TDataType's kchar.
static void * CopyIterator(void *dest, const void *source)
virtual TStreamerInfoActions::TActionSequence * GetConversionReadMemberWiseActions(TClass *oldClass, Int_t version)=0
virtual TClass * GetValueClass() const =0
void AddAction(action_t action, TConfiguration *conf)
TObject * GetParent() const
Return pointer to parent of this buffer.
static void * Next(void *iter, const void *end)
R__EXTERN TVirtualMutex * gInterpreterMutex
T ReadBuffer(TBufferFile *buf)
One of the template functions used to read objects from messages.
virtual void PrintDebug(TBuffer &buffer, void *object) const
Bool_t TestBit(UInt_t f) const
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
static TConfiguredAction GetNumericCollectionReadAction(Int_t type, TConfigSTL *conf)
INLINE_TEMPLATE_ARGS Int_t ReadBasicType< BitsMarker >(TBuffer &buf, void *addr, const TConfiguration *config)
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
INLINE_TEMPLATE_ARGS Int_t ReadBasicType_NoFactor(TBuffer &buf, void *addr, const TConfiguration *config)
TMemberStreamer * GetStreamer() const
Return the local streamer object.
virtual void Commit(void *)=0
INLINE_TEMPLATE_ARGS Int_t UseCacheVectorLoop(TBuffer &b, void *start, const void *end, const TLoopConfiguration *loopconf, const TConfiguration *conf)
Buffer base class used for serializing objects.
INLINE_TEMPLATE_ARGS Int_t ReadTObject(TBuffer &buf, void *addr, const TConfiguration *config)
virtual TClass * GetCollectionClass() const
virtual void Print() const
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
void AddWriteAction(TStreamerInfoActions::TActionSequence *writeSequence, Int_t index, TCompInfo *compinfo)
UInt_t fElemId
Identifier of the TStreamerElement.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Int_t GetArrayLength() const
Cache the value in memory than is not part of the object but is accessible via a SchemaRule.
virtual UShort_t GetPidOffset() const =0
void AddWriteMemberWiseVecPtrAction(TStreamerInfoActions::TActionSequence *writeSequence, Int_t index, TCompInfo *compinfo)
This is for streaming via a TClonesArray (or a vector of pointers of this type).
virtual DeleteIterator_t GetFunctionDeleteIterator(Bool_t read=kTRUE)=0
TObject * At(Int_t idx) const
Int_t GetArrayDim() const
INLINE_TEMPLATE_ARGS Int_t ReadTString(TBuffer &buf, void *addr, const TConfiguration *config)
virtual EDataType GetType() const =0
void GetSequenceType(TString &type) const
Fill type with the string representation of sequence information including 'cached','repeat','write' or 'nodelete'.
void *(* CopyIterator_t)(void *dest, const void *source)
INLINE_TEMPLATE_ARGS void ReadArraySTLMemberWiseSameClass(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t vers)
TCompInfo ** fCompFull
![fElements->GetEntries()]
static TActionSequence * CreateReadMemberWiseActions(TVirtualStreamerInfo *info, TVirtualCollectionProxy &proxy)
Create the bundle of the actions necessary for the streaming memberwise of the content described by '...
virtual void ReadInt(Int_t &i)=0
TVirtualCollectionProxy::Next_t Next_t
TActionSequence * CreateSubSequence(const std::vector< Int_t > &element_ids, size_t offset)
void(* DeleteIterator_t)(void *iter)
INLINE_TEMPLATE_ARGS void ReadSTLMemberWiseChangedClass(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t vers)
static TConfiguredAction GetCollectionReadAction(TVirtualStreamerInfo *info, TStreamerElement *element, Int_t type, UInt_t i, TStreamerInfo::TCompInfo_t *compinfo, Int_t offset)
TActionSequence * CreateCopy()
virtual void ReadWithNbits(Float_t *ptr, Int_t nbits)=0
virtual Int_t GetClassVersion() const =0
INLINE_TEMPLATE_ARGS Int_t WriteBasicType(TBuffer &buf, void *addr, const TConfiguration *config)
virtual const char * ClassName() const
Returns name of class to which the object belongs.
char * GetObjectAt(UInt_t ind) const
virtual TProcessID * ReadProcessID(UShort_t pidf)=0
Return the current Process-ID.
virtual void Copy(TObject &object) const
Copy this to obj.
Int_t WriteLoopInvalid(TBuffer &, void *, const void *, const TConfiguration *config)
virtual TLoopConfiguration * Copy()=0
A TProcessID identifies a ROOT job in a unique way in time and space.
Base class of the Configurations for the member wise looping routines.
Int_t ReadLoopInvalid(TBuffer &, void *, const void *, const TConfiguration *config)
void Error(const char *location, const char *msgfmt,...)
virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators(Bool_t read=kTRUE)=0
virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read=kTRUE)=0
Int_t GenericWriteAction(TBuffer &buf, void *addr, const TConfiguration *config)
ESelectLooper SelectLooper(TVirtualCollectionProxy &proxy)
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
INLINE_TEMPLATE_ARGS void ReadSTLObjectWiseFastArray(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t, UInt_t)
virtual Version_t ReadVersionForMemberWise(const TClass *cl=0)=0
static TConfiguredAction GetCollectionReadConvertAction(Int_t newtype, TConfiguration *conf)
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
TClass * GetClass() const
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0)=0
static TConfiguredAction GetCollectionWriteAction(TVirtualStreamerInfo *info, TStreamerElement *, Int_t type, UInt_t i, TStreamerInfo::TCompInfo_t *compinfo, Int_t offset)
virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object)=0
void(* CreateIterators_t)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
Int_t fOffset
Offset within the object.
virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue)=0
virtual Bool_t HasPointers() const =0
static TActionSequence * CreateWriteMemberWiseActions(TVirtualStreamerInfo *info, TVirtualCollectionProxy &proxy)
Create the bundle of the actions necessary for the streaming memberwise of the content described by '...
virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0)=0
virtual void Print() const
Int_t Size() const
Return size of object of this class.
virtual TVirtualArray * PeekDataCache() const
Return the 'current' data cache area from the list of area to be used for temporarily store 'missing'...
virtual void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue)=0
The ROOT global object gROOT contains a list of all defined classes.
char * Strip(const char *str, char c=' ')
Strip leading and trailing c (blanks by default) from a string.
TStreamerInfoActions::TActionSequence * GetReadMemberWiseActions(Bool_t forCollection)
INLINE_TEMPLATE_ARGS void ReadSTLObjectWiseStreamer(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t, UInt_t)
void Warning(const char *location, const char *msgfmt,...)
INLINE_TEMPLATE_ARGS Int_t ReadBasicType(TBuffer &buf, void *addr, const TConfiguration *config)
static const Int_t fgIteratorArenaSize
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
INLINE_TEMPLATE_ARGS Int_t UseCacheGenericCollection(TBuffer &b, void *, const void *, const TLoopConfiguration *loopconfig, const TConfiguration *conf)
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
INLINE_TEMPLATE_ARGS void ReadSTLObjectWiseStreamerV2(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t vers, UInt_t start)
TStreamerElement * fElem
Not Owned.
virtual ULong_t GetIncrement() const =0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
void HandleReferencedTObject(TBuffer &buf, void *addr, const TConfiguration *config)
void Copy(void *source, void *dest)
void Print(Option_t *="") const
This method must be overridden when a class wants to print itself.
#define INLINE_TEMPLATE_ARGS
void Print(std::ostream &os, const OptionType &opt)
virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits)=0
virtual TObjArray * GetElements() const =0
INLINE_TEMPLATE_ARGS Int_t UseCache(TBuffer &b, void *addr, const TConfiguration *conf)
Double_t GetFactor() const
virtual Int_t GetSize() const
Returns size of this element in bytes.
static const Int_t kRegrouped
virtual Bool_t HasCounter() const
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
double func(double *x, double *p)
static void DeleteIterator(void *iter)
#define R__LOCKGUARD(mutex)
static TConfiguredAction GetConvertCollectionReadAction(Int_t oldtype, Int_t newtype, TConfiguration *conf)
void Compile()
loop on the TStreamerElement list regroup members with same type Store predigested information into l...
virtual CopyIterator_t GetFunctionCopyIterator(Bool_t read=kTRUE)=0
Mother of all ROOT objects.
virtual UInt_t Size() const =0
typedef void((*Func_t)())
INLINE_TEMPLATE_ARGS void ReadSTLObjectWiseFastArrayV2(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t vers, UInt_t start)
const char * GetTypeName() const
INLINE_TEMPLATE_ARGS Int_t ReadTNamed(TBuffer &buf, void *addr, const TConfiguration *config)
TClass * GetNewClass() const
INLINE_TEMPLATE_ARGS void ReadArraySTLMemberWiseChangedClass(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t vers)
static const char * R__GetSymbolName(voidfunc func)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Int_t GetEntries() const
Return the number of objects in array (i.e.
INLINE_TEMPLATE_ARGS Int_t UseCacheVectorPtrLoop(TBuffer &b, void *start, const void *end, const TConfiguration *conf)
void *(* Next_t)(void *iter, const void *end)
virtual ULong_t GetMethod() const
Int_t GenericReadAction(TBuffer &buf, void *addr, const TConfiguration *config)
const char * GetErrorMessage() const
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetSize() const
Abstract Interface class describing Streamer information for one class.
Int_t ReadBufferSTL(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc, Int_t eoffset, Bool_t v7=kTRUE)
The STL vector/list is deserialized from the buffer b.
void(* DeleteTwoIterators_t)(void *begin, void *end)
Base class of the Configurations.
UInt_t fLength
Number of element in a fixed length array.
INLINE_TEMPLATE_ARGS void ReadSTLMemberWiseSameClass(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t vers)
TStreamerInfoActions::TActionSequence * GetWriteMemberWiseActions(Bool_t forCollection)
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
void AddToOffset(Int_t delta)
TCompInfo_t * fCompInfo
Access to compiled information (for legacy code)