35 using namespace TStreamerInfoActions;
38 # define INLINE_TEMPLATE_ARGS
40 # define INLINE_TEMPLATE_ARGS inline
44 namespace TStreamerInfoActions
46 template <
typename From>
47 struct WithFactorMarker {
51 template <
typename From>
52 struct NoFactorMarker {
85 printf(
"StreamerInfoAction, class:%s, name=%s, fType[%d]=%d,"
86 " %s, offset=%d (%s)\n",
102 printf(
"StreamerInfoAction, class:%s, name=%s, fType[%d]=%d,"
103 " %s, bufpos=%d, arr=%p, offset=%d (%s)\n",
113 printf(
"TLoopConfiguration: unconfigured\n");
122 void PrintDebug(
TBuffer &,
void *)
const {
138 void PrintDebug(
TBuffer &,
void *)
const {
144 printf(
"StreamerInfoAction, class:%s, name=%s, fType[%d]=%d,"
145 " %s, offset=%d (%s)\n",
150 void AddToOffset(
Int_t delta)
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);
209 UInt_t *x = (
UInt_t*)( ((
char*)addr) + config->fOffset );
214 if ((*x & kIsReferenced) != 0) {
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() {};
397 printf(
"TAssocLoopConfig: proxy=%s\n",fProxy->GetCollectionClass()->GetName());
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() {};
445 printf(
"TGenericLoopConfig: proxy=%s\n",fProxy->GetCollectionClass()->GetName());
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;
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> {
775 if ((temp & kIsReferenced) != 0) {
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;
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() {};
833 TConfigurationUseCache *copy =
new TConfigurationUseCache(*
this);
834 fAction.fConfiguration = copy->fAction.fConfiguration->Copy();
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 ) {
1016 if ((temp & kIsReferenced) != 0) {
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*) ) {
1388 if ((temp & kIsReferenced) != 0) {
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>
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>
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)) ) {
1754 if (((*items) & kIsReferenced) != 0) {
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>
1974 case TStreamerInfo::kBits:
Error(
"GetNumericCollectionReadAction",
"There is no support for kBits outside of a TObject.");
break;
1976 TConfigSTL *alternate =
new TConfSTLNoFactor(conf,12);
1989 TConfigSTL *alternate =
new TConfSTLNoFactor(conf,0);
2005 Fatal(
"GetNumericCollectionReadAction",
"Is confused about %d",type);
2010 template <
typename Looper,
typename From>
2037 template <
typename Looper>
2042 return GetConvertCollectionReadActionFrom<Looper,Bool_t>(newtype, conf );
2045 return GetConvertCollectionReadActionFrom<Looper,Char_t>(newtype, conf );
2048 return GetConvertCollectionReadActionFrom<Looper,Short_t>(newtype, conf );
2051 return GetConvertCollectionReadActionFrom<Looper,Int_t>(newtype, conf );
2054 return GetConvertCollectionReadActionFrom<Looper,Long_t>(newtype, conf );
2057 return GetConvertCollectionReadActionFrom<Looper,Long64_t>(newtype, conf );
2060 return GetConvertCollectionReadActionFrom<Looper,Float_t>( newtype, conf );
2063 return GetConvertCollectionReadActionFrom<Looper,Double_t>(newtype, conf );
2066 return GetConvertCollectionReadActionFrom<Looper,UChar_t>(newtype, conf );
2069 return GetConvertCollectionReadActionFrom<Looper,UShort_t>(newtype, conf );
2072 return GetConvertCollectionReadActionFrom<Looper,UInt_t>(newtype, conf );
2075 return GetConvertCollectionReadActionFrom<Looper,ULong_t>(newtype, conf );
2078 return GetConvertCollectionReadActionFrom<Looper,ULong64_t>(newtype, conf );
2081 return GetConvertCollectionReadActionFrom<Looper,NoFactorMarker<Float16_t> >( newtype, conf );
2084 return GetConvertCollectionReadActionFrom<Looper,NoFactorMarker<Double32_t> >( newtype, conf );
2087 Error(
"GetConvertCollectionReadAction",
"There is no support for kBits outside of a TObject.");
2096 template <
class Looper>
2117 return TConfiguredAction( Looper::template ReadAction<ReadBasicType_WithFactor<float> >,
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
2120 if (!nbits) nbits = 12;
2121 return TConfiguredAction( Looper::template ReadAction<ReadBasicType_NoFactor<float> >,
new TConfNoFactor(info,i,compinfo,offset,nbits) );
2127 return TConfiguredAction( Looper::template ReadAction<ReadBasicType_WithFactor<double> >,
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
2133 return TConfiguredAction( Looper::template ReadAction<ReadBasicType_NoFactor<double> >,
new TConfNoFactor(info,i,compinfo,offset,nbits) );
2151 return GetCollectionReadConvertAction<Looper,Bool_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2154 return GetCollectionReadConvertAction<Looper,Char_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2157 return GetCollectionReadConvertAction<Looper,Short_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2160 return GetCollectionReadConvertAction<Looper,Int_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2163 return GetCollectionReadConvertAction<Looper,Long_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2166 return GetCollectionReadConvertAction<Looper,Long64_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2169 return GetCollectionReadConvertAction<Looper,Float_t>( element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2172 return GetCollectionReadConvertAction<Looper,Double_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2175 return GetCollectionReadConvertAction<Looper,UChar_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2178 return GetCollectionReadConvertAction<Looper,UShort_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2181 return GetCollectionReadConvertAction<Looper,UInt_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2184 return GetCollectionReadConvertAction<Looper,ULong_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2187 return GetCollectionReadConvertAction<Looper,ULong64_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2190 return GetCollectionReadConvertAction<Looper,BitsMarker>(element->
GetNewType(),
new TBitsConfiguration(info,i,compinfo,offset) );
2194 return GetCollectionReadConvertAction<Looper,WithFactorMarker<float> >(element->
GetNewType(),
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
2197 if (!nbits) nbits = 12;
2198 return GetCollectionReadConvertAction<Looper,NoFactorMarker<float> >(element->
GetNewType(),
new TConfNoFactor(info,i,compinfo,offset,nbits) );
2204 return GetCollectionReadConvertAction<Looper,WithFactorMarker<double> >(element->
GetNewType(),
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
2208 return GetCollectionReadConvertAction<Looper,Float_t>(element->
GetNewType(),
new TConfiguration(info,i,compinfo,offset) );
2210 return GetCollectionReadConvertAction<Looper,NoFactorMarker<double> >(element->
GetNewType(),
new TConfNoFactor(info,i,compinfo,offset,nbits) );
2216 return TConfiguredAction( Looper::GenericRead,
new TGenericConfiguration(info,i,compinfo) );
2223 template <
class Looper>
2320 fNslots = ndata + ndata/2 + 1;
2339 for (i = 0; i <
ndata; ++i) {
2384 if (!previousOptimized) {
2395 if (
fComp[keep].fLength == 0) {
2400 isOptimized =
kTRUE;
2401 previousOptimized =
kTRUE;
2402 }
else if (element->
GetType() < 0) {
2415 previousOptimized =
kFALSE;
2433 Warning(
"Compile",
"Counter %s should not be skipped from class %s", element->
GetName(),
GetName());
2444 if (
fComp[keep].fLength == 0) {
2448 previousOptimized =
kFALSE;
2458 for (i = 0; i <
fNdata; ++i) {
2484 template <
typename From>
2516 switch (compinfo->
fType) {
2534 readSequence->
AddAction( ReadBasicType_WithFactor<float>,
new TConfWithFactor(
this,i,compinfo,compinfo->
fOffset,element->
GetFactor(),element->
GetXmin()) );
2537 if (!nbits) nbits = 12;
2538 readSequence->
AddAction( ReadBasicType_NoFactor<float>,
new TConfNoFactor(
this,i,compinfo,compinfo->
fOffset,nbits) );
2544 readSequence->
AddAction( ReadBasicType_WithFactor<double>,
new TConfWithFactor(
this,i,compinfo,compinfo->
fOffset,element->
GetFactor(),element->
GetXmin()) );
2550 readSequence->
AddAction( ReadBasicType_NoFactor<double>,
new TConfNoFactor(
this,i,compinfo,compinfo->
fOffset,nbits) );
2567 if (newClass && newClass != oldClass) {
2569 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseChangedClass,ReadSTLObjectWiseStreamerV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2571 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseChangedClass,ReadSTLObjectWiseFastArrayV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetTypeName(),isSTLbase));
2575 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseSameClass,ReadSTLObjectWiseStreamerV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2577 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseSameClass,ReadSTLObjectWiseFastArrayV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,element->
GetTypeName(),isSTLbase));
2581 if (newClass && newClass != oldClass) {
2583 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseChangedClass,ReadSTLObjectWiseStreamer>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2586 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseChangedClass,ReadSTLObjectWiseFastArray>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetTypeName(),isSTLbase));
2590 readSequence->
AddAction(GetConvertCollectionReadAction<VectorLooper>(oldClass->
GetCollectionProxy()->
GetType(), newClass->
GetCollectionProxy()->
GetType(),
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetTypeName(),isSTLbase)));
2593 readSequence->
AddAction(GetConvertCollectionReadAction<AssociativeLooper>(oldClass->
GetCollectionProxy()->
GetType(), newClass->
GetCollectionProxy()->
GetType(),
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetTypeName(),isSTLbase)));
2599 readSequence->
AddAction(GetConvertCollectionReadAction<GenericLooper>(oldClass->
GetCollectionProxy()->
GetType(), newClass->
GetCollectionProxy()->
GetType(),
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,newClass,element->
GetTypeName(),isSTLbase)));
2606 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseSameClass,ReadSTLObjectWiseStreamer>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2609 readSequence->
AddAction(ReadSTL<ReadSTLMemberWiseSameClass,ReadSTLObjectWiseFastArray>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,1,oldClass,element->
GetTypeName(),isSTLbase));
2631 if (newClass && newClass != oldClass) {
2633 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseChangedClass,ReadSTLObjectWiseStreamerV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,newClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2635 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseChangedClass,ReadSTLObjectWiseFastArrayV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,newClass,element->
GetTypeName(),isSTLbase));
2639 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseSameClass,ReadSTLObjectWiseStreamerV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2641 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseSameClass,ReadSTLObjectWiseFastArrayV2>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,element->
GetTypeName(),isSTLbase));
2645 if (newClass && newClass != oldClass) {
2647 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseChangedClass,ReadSTLObjectWiseStreamer>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,newClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2649 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseChangedClass,ReadSTLObjectWiseFastArray>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,newClass,element->
GetTypeName(),isSTLbase));
2653 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseSameClass,ReadSTLObjectWiseStreamer>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,element->
GetStreamer(),element->
GetTypeName(),isSTLbase));
2655 readSequence->
AddAction(ReadSTL<ReadArraySTLMemberWiseSameClass,ReadSTLObjectWiseFastArray>,
new TConfigSTL(
this,i,compinfo,compinfo->
fOffset,element->
GetArrayLength(),oldClass,element->
GetTypeName(),isSTLbase));
2703 AddReadConvertAction<BitsMarker>(readSequence, compinfo->
fNewType,
new TBitsConfiguration(
this,i,compinfo,compinfo->
fOffset) );
2707 AddReadConvertAction<WithFactorMarker<float> >(readSequence, compinfo->
fNewType,
new TConfWithFactor(
this,i,compinfo,compinfo->
fOffset,element->
GetFactor(),element->
GetXmin()) );
2710 if (!nbits) nbits = 12;
2711 AddReadConvertAction<NoFactorMarker<float> >(readSequence, compinfo->
fNewType,
new TConfNoFactor(
this,i,compinfo,compinfo->
fOffset,nbits) );
2717 AddReadConvertAction<WithFactorMarker<double> >(readSequence, compinfo->
fNewType,
new TConfWithFactor(
this,i,compinfo,compinfo->
fOffset,element->
GetFactor(),element->
GetXmin()) );
2723 AddReadConvertAction<NoFactorMarker<double> >(readSequence, compinfo->
fNewType,
new TConfNoFactor(
this,i,compinfo,compinfo->
fOffset,nbits) );
2729 readSequence->AddAction(
GenericReadAction,
new TGenericConfiguration(
this,i,compinfo) );
2753 readSequence->
AddAction( GetCollectionReadAction<VectorPtrLooper>(
this,element,compinfo->
fType,i,compinfo,compinfo->
fOffset) );
2770 switch (compinfo->
fType) {
2854 #if defined(CDJ_NO_COMPILE)
2857 writeSequence->
fActions.pop_back();
2878 #if defined(CDJ_NO_COMPILE)
2883 writeSequence->Addaction( GetCollectionWriteAction<VectorPtrLooper>(
this,element,compinfo->
fType,i,compinfo,compinfo->
fOffset) );
2886 writeSequence->
AddAction( VectorPtrLooper::GenericWrite,
new TGenericConfiguration(
this,i,compinfo) );
2953 ::Warning(
"CreateReadMemberWiseActions",
"%s",
2968 if (newType != oldType) {
2986 TConfiguredAction action( GetCollectionReadAction<VectorLooper>(info,element,oldType,i,compinfo,offset) );
2989 sequence->
AddAction( GetCollectionReadAction<VectorLooper>(info,element,oldType,i,compinfo,offset));
2996 TConfiguredAction action( GetCollectionReadAction<VectorLooper>(info,element,oldType,i,compinfo,offset) );
2999 sequence->
AddAction( GetCollectionReadAction<GenericLooper>(info,element,oldType,i,compinfo,offset) );
3071 #if defined(CDJ_NO_COMPILE)
3074 if (newType != oldType) {
3090 TConfiguredAction action( GetCollectionWriteAction<VectorLooper>(info,element,oldType,i,compinfo,offset) );
3093 sequence->
AddAction(GetCollectionWriteAction<VectorLooper>(info,element,oldType,i,compinfo,offset));
3102 TConfiguredAction action( GetWriteAction<VectorLooper>(info,element,oldType,i,compinfo,offset) );
3123 sequence->
AddAction( GenericLooper<WriteBasicType_WithFactor<float> >,
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
3126 if (!nbits) nbits = 12;
3127 sequence->
AddAction( GenericLooper<WriteBasicType_NoFactor<float> >,
new TConfNoFactor(info,i,compinfo,offset,nbits) );
3133 sequence->
AddAction( GenericLooper<WriteBasicType_WithFactor<double> >,
new TConfWithFactor(info,i,compinfo,offset,element->
GetFactor(),element->
GetXmin()) );
3137 sequence->
AddAction( GenericLooper<ConvertBasicType<float,double> >,
new TConfiguration(info,i,compinfo,offset) );
3139 sequence->
AddAction( GenericLooper<WriteBasicType_NoFactor<double> >,
new TConfNoFactor(info,i,compinfo,offset,nbits) );
3160 sequence->
AddAction( GetCollectionWriteAction<VectorLooper>(info,element,oldType,i,compinfo,offset) );
3177 TStreamerInfoActions::ActionContainer_t::iterator end = fActions.end();
3178 for(TStreamerInfoActions::ActionContainer_t::iterator iter = fActions.begin();
3182 if (!iter->fConfiguration->fInfo->GetElements()->At(iter->fConfiguration->fElemId)->TestBit(
TStreamerElement::kCache))
3183 iter->fConfiguration->AddToOffset(delta);
3195 TStreamerInfoActions::ActionContainer_t::iterator end = fActions.end();
3196 for(TStreamerInfoActions::ActionContainer_t::iterator iter = fActions.begin();
3201 sequence->
AddAction( iter->fAction, conf );
3215 for(
UInt_t id = 0;
id < element_ids.size(); ++
id) {
3216 if ( element_ids[
id] < 0 ) {
3217 TStreamerInfoActions::ActionContainer_t::iterator end = fActions.end();
3218 for(TStreamerInfoActions::ActionContainer_t::iterator iter = fActions.begin();
3223 if (!iter->fConfiguration->fInfo->GetElements()->At(iter->fConfiguration->fElemId)->TestBit(
TStreamerElement::kCache))
3225 sequence->
AddAction( iter->fAction, conf );
3228 TStreamerInfoActions::ActionContainer_t::iterator end = fActions.end();
3229 for(TStreamerInfoActions::ActionContainer_t::iterator iter = fActions.begin();
3232 if ( iter->fConfiguration->fElemId == (
UInt_t)element_ids[
id] ) {
3234 if (!iter->fConfiguration->fInfo->GetElements()->At(iter->fConfiguration->fElemId)->TestBit(
TStreamerElement::kCache))
3236 sequence->
AddAction( iter->fAction, conf );
3244 #if !defined(R__WIN32) && !defined(_AIX)
3253 #if defined(R__WIN32) || defined(__CYGWIN__) || defined(_AIX)
3254 return "not available on this platform";
3256 MEMORY_BASIC_INFORMATION mbi;
3257 if (!VirtualQuery (func, &mbi,
sizeof (mbi)))
3262 HMODULE hMod = (HMODULE) mbi.AllocationBase;
3263 static char moduleName[MAX_PATH];
3265 if (!GetModuleFileNameA (hMod, moduleName,
sizeof (moduleName)))
3273 if (dladdr((
void*)func,&info)==0) {
3275 return "name not found";
3278 return info.dli_sname;
3290 fLoopConfig->Print();
3292 TStreamerInfoActions::ActionContainer_t::const_iterator end = fActions.end();
3293 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = fActions.begin();
3297 iter->fConfiguration->Print();
3298 if (strstr(opt,
"func")) {
TObject * GetParent() const
Return pointer to parent of this buffer.
Describe Streamer information for one class version.
virtual void PrintDebug(TBuffer &buffer, void *object) const
void(* DeleteIterator_t)(void *iter)
void SetBufferOffset(Int_t offset=0)
virtual Int_t GetCollectionType() const =0
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 Int_t GetProperties() const
TClass * fNewClass
Not Owned.
virtual void * Allocate(UInt_t n, Bool_t forceDelete)=0
TVirtualStreamerInfo * fInfo
TStreamerInfo form which the action is derived.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
static void AddReadConvertAction(TStreamerInfoActions::TActionSequence *sequence, Int_t newtype, TConfiguration *conf)
Version_t fOldVersion
! Version of the TStreamerInfo object read from the file
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 void Print() const
void AddReadMemberWiseVecPtrAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read action for the given element.
const char * GetTypeName() const
TStreamerInfoActions::TActionSequence * fWriteMemberWiseVecPtr
! List of write action resulting from the compilation for use in member wise streaming.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
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)
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.
static TConfiguredAction GetNumericCollectionReadAction(Int_t type, TConfigSTL *conf)
INLINE_TEMPLATE_ARGS Int_t ReadBasicType< BitsMarker >(TBuffer &buf, void *addr, const TConfiguration *config)
INLINE_TEMPLATE_ARGS Int_t ReadBasicType_NoFactor(TBuffer &buf, void *addr, const TConfiguration *config)
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)
TClass * GetNewClass() 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.
virtual Int_t GetSize() const
Returns size of this element in bytes.
virtual TVirtualArray * PeekDataCache() const
Return the 'current' data cache area from the list of area to be used for temporarily store 'missing'...
Cache the value in memory than is not part of the object but is accessible via a SchemaRule.
Int_t fNdata
!number of optimized elements
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
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
INLINE_TEMPLATE_ARGS Int_t ReadTString(TBuffer &buf, void *addr, const TConfiguration *config)
virtual EDataType GetType() const =0
void *(* CopyIterator_t)(void *dest, const void *source)
Double_t GetFactor() const
INLINE_TEMPLATE_ARGS void ReadArraySTLMemberWiseSameClass(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t vers)
TCompInfo ** fCompFull
![fElements->GetEntries()]
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
static TActionSequence * CreateReadMemberWiseActions(TVirtualStreamerInfo *info, TVirtualCollectionProxy &proxy)
Create the bundle of the actions necessary for the streaming memberwise of the content described by '...
virtual TClass * GetCollectionClass() const
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 ComputeSize()
Compute total size of all persistent elements of the class.
TStreamerInfoActions::TActionSequence * fReadMemberWise
! List of read action resulting from the compilation for use in member wise streaming.
const char * Data() const
INLINE_TEMPLATE_ARGS void ReadSTLMemberWiseChangedClass(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t vers)
Int_t fSize
!size of the persistent class
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 TProcessID * ReadProcessID(UShort_t pidf)=0
Return the current Process-ID.
Bool_t IsCompiled() const
void Init(TClassEdit::TInterpreterLookupHelper *helper)
std::map< std::string, std::string >::const_iterator iter
Int_t WriteLoopInvalid(TBuffer &, void *, const void *, const TConfiguration *config)
if(pyself &&pyself!=Py_None)
TMemberStreamer * fStreamer
Not Owned.
Int_t fNfulldata
!number of elements
TStreamerInfoActions::TActionSequence * fReadObjectWise
! List of read action resulting from the compilation.
virtual TLoopConfiguration * Copy()=0
TClass * GetClass() const
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
Int_t GetArrayDim() const
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)
TClass * fClass
!pointer to class
TObjArray * fElements
Array of TStreamerElements.
void ls(Option_t *option="") const
List the TStreamerElement list and also the precomputed tables if option contains the string "incOrig...
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Double_t length(const TVector2 &v)
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)
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object)=0
Int_t fOffset
Offset within the object.
virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue)=0
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual Bool_t HasPointers() const =0
char * Strip(const char *str, char c= ' ')
Strip leading and trailing c (blanks by default) from a string.
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
Bool_t TestBit(UInt_t f) const
virtual const char * GetName() const
Returns name of object.
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.
void Print(Option_t *="") const
This method must be overridden when a class wants to print itself.
TStreamerInfoActions::TActionSequence * GetReadMemberWiseActions(Bool_t forCollection)
INLINE_TEMPLATE_ARGS void ReadSTLObjectWiseStreamer(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t, UInt_t)
static Bool_t CanOptimize()
static function returning true if optimization can be on
void Warning(const char *location, const char *msgfmt,...)
INLINE_TEMPLATE_ARGS Int_t ReadBasicType(TBuffer &buf, void *addr, const TConfiguration *config)
TClass * fClass
Not Owned.
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)
TCompInfo * fComp
![fNslots with less than fElements->GetEntries()*1.5 used] Compiled info
TStreamerInfoActions::TActionSequence * fWriteMemberWise
! List of write action resulting from the compilation for use in member wise streaming.
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
virtual Int_t GetSize() const
void HandleReferencedTObject(TBuffer &buf, void *addr, const TConfiguration *config)
void Copy(void *source, void *dest)
#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 const char * GetName() const
Returns name of object.
virtual TObjArray * GetElements() const =0
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
void(* CreateIterators_t)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
Int_t fNslots
!total numbrer of slots in fComp.
TStreamerInfoActions::TActionSequence * fReadMemberWiseVecPtr
! List of read action resulting from the compilation for use in member wise streaming.
TStreamerInfoActions::TActionSequence * fWriteObjectWise
! List of write action resulting from the compilation.
INLINE_TEMPLATE_ARGS Int_t UseCache(TBuffer &b, void *addr, const TConfiguration *conf)
virtual void Print() const
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
static const Int_t kRegrouped
void *(* Next_t)(void *iter, const void *end)
double func(double *x, double *p)
Int_t fNVirtualInfoLoc
! Number of virtual info location to update.
static void DeleteIterator(void *iter)
#define R__LOCKGUARD(mutex)
Int_t GetEntries() const
Return the number of objects in array (i.e.
static TConfiguredAction GetConvertCollectionReadAction(Int_t oldtype, Int_t newtype, TConfiguration *conf)
TMemberStreamer * GetStreamer() const
Return the local streamer object.
void Compile()
loop on the TStreamerElement list regroup members with same type Store predigested information into l...
const char * GetErrorMessage() const
virtual CopyIterator_t GetFunctionCopyIterator(Bool_t read=kTRUE)=0
virtual UInt_t GetUniqueID() const
Return the unique object id.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Mother of all ROOT objects.
virtual UInt_t Size() const =0
virtual ULong_t GetMethod() const
typedef void((*Func_t)())
Int_t fNumber
!Unique identifier
INLINE_TEMPLATE_ARGS void ReadSTLObjectWiseFastArrayV2(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t vers, UInt_t start)
void GetSequenceType(TString &type) const
Fill type with the string representation of sequence information including 'cached','repeat','write' or 'nodelete'.
INLINE_TEMPLATE_ARGS Int_t ReadTNamed(TBuffer &buf, void *addr, const TConfiguration *config)
char * GetObjectAt(UInt_t ind) const
INLINE_TEMPLATE_ARGS void ReadArraySTLMemberWiseChangedClass(TBuffer &buf, void *addr, const TConfiguration *conf, Version_t vers)
static const char * R__GetSymbolName(voidfunc func)
virtual Bool_t HasCounter() const
virtual TConfiguration * Copy()
INLINE_TEMPLATE_ARGS Int_t UseCacheVectorPtrLoop(TBuffer &b, void *start, const void *end, const TConfiguration *conf)
TCompInfo ** fCompOpt
![fNdata]
void(* DeleteTwoIterators_t)(void *begin, void *end)
Int_t GenericReadAction(TBuffer &buf, void *addr, const TConfiguration *config)
TObject * At(Int_t idx) 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.
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)
Int_t Size() const
Return size of object of this class.
TStreamerInfoActions::TActionSequence * GetWriteMemberWiseActions(Bool_t forCollection)
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
Int_t GetArrayLength() const
void AddToOffset(Int_t delta)
TCompInfo_t * fCompInfo
Access to compiled information (for legacy code)
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.