[root] / branches / v5-26-00-patches / io / io / src / TStreamerInfoReadBuffer.cxx Repository:
ViewVC logotype

Diff of /branches/v5-26-00-patches/io/io/src/TStreamerInfoReadBuffer.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 33173, Sat Apr 24 21:35:39 2010 UTC revision 33174, Sat Apr 24 21:37:25 2010 UTC
# Line 1054  Line 1054 
1054              {              {
1055                 UInt_t start,count;                 UInt_t start,count;
1056                 Version_t vers = b.ReadVersion(&start, &count, cle);                 Version_t vers = b.ReadVersion(&start, &count, cle);
1057    
1058                 if ( vers & TBufferFile::kStreamedMemberWise ) {                 if ( vers & TBufferFile::kStreamedMemberWise ) {
1059                    // Collection was saved member-wise                    // Collection was saved member-wise
1060    
1061                    vers &= ~( TBufferFile::kStreamedMemberWise );                    vers &= ~( TBufferFile::kStreamedMemberWise );
1062                    TVirtualCollectionProxy *proxy = aElement->GetClassPointer()->GetCollectionProxy();                    TClass *newClass = aElement->GetNewClass();
1063                    TStreamerInfo *subinfo = (TStreamerInfo*)proxy->GetValueClass()->GetStreamerInfo();                    TClass *oldClass = aElement->GetClassPointer();
1064                      if( vers < 9 && newClass && newClass!=oldClass ) {
1065                         Error( "ReadBuffer", "Unfortunately, version %d of TStreamerInfo (used in %s) did not record enough information to convert a %d into a %s.",
1066                               vers, b.GetParent() ? b.GetParent()->GetName() : "memory/socket", oldClass->GetName(), newClass->GetName() );
1067                         continue;
1068                      }
1069    
1070                      UInt_t startDummy, countDummy;
1071                      Version_t vClVersion = 0; // For vers less than 9, we have to use the current version.
1072                      if( vers >= 9 ) {
1073                         vClVersion = b.ReadVersion( &startDummy, &countDummy, cle->GetCollectionProxy()->GetValueClass() );
1074                      }
1075    
1076                      TVirtualCollectionProxy *newProxy = (newClass ? newClass->GetCollectionProxy() : 0);
1077                      TVirtualCollectionProxy *oldProxy = oldClass->GetCollectionProxy();
1078                      TStreamerInfo *subinfo = 0;
1079    
1080                      if( newProxy ) {
1081                         subinfo = (TStreamerInfo*)newProxy->GetValueClass()->GetConversionStreamerInfo( oldProxy->GetValueClass(), vClVersion );
1082                      } else {
1083                         subinfo = (TStreamerInfo*)oldProxy->GetValueClass()->GetStreamerInfo( vClVersion );
1084                         newProxy = oldProxy;
1085                      }
1086    
1087                    DOLOOP {                    DOLOOP {
1088                       void* env;                       void* env;
1089                       void **contp = (void**)(arr[k]+ioffset);                       void **contp = (void**)(arr[k]+ioffset);
# Line 1070  Line 1094 
1094                             contp[j] = cle->New();                             contp[j] = cle->New();
1095                             cont = contp[j];                             cont = contp[j];
1096                          }                          }
1097                          TVirtualCollectionProxy::TPushPop helper( proxy, cont );                          TVirtualCollectionProxy::TPushPop helper( newProxy, cont );
1098                          Int_t nobjects;                          Int_t nobjects;
1099                          b >> nobjects;                          b >> nobjects;
1100                          env = proxy->Allocate(nobjects,true);                          env = newProxy->Allocate(nobjects,true);
1101                          if (vers<7) {                          if (vers<7) {
1102                             subinfo->ReadBuffer(b,*proxy,-1,nobjects,0,1);                             subinfo->ReadBuffer(b,*newProxy,-1,nobjects,0,1);
1103                          } else {                          } else {
1104                             subinfo->ReadBufferSTL(b,proxy,nobjects,-1,0);                             subinfo->ReadBufferSTL(b,newProxy,nobjects,-1,0);
1105                          }                          }
1106                          proxy->Commit(env);                          newProxy->Commit(env);
1107                       }                       }
1108                    }                    }
1109                    b.CheckByteCount(start,count,aElement->GetFullName());                    b.CheckByteCount(start,count,aElement->GetFullName());
# Line 1112  Line 1136 
1136           case TStreamerInfo::kSTL:                // Container with no virtual table (stl) and no comment           case TStreamerInfo::kSTL:                // Container with no virtual table (stl) and no comment
1137           case TStreamerInfo::kSTL + TStreamerInfo::kOffsetL:     // array of Container with no virtual table (stl) and no comment           case TStreamerInfo::kSTL + TStreamerInfo::kOffsetL:     // array of Container with no virtual table (stl) and no comment
1138              {              {
1139                 UInt_t start, count, startDummy, countDummy;                 UInt_t start, count;
1140                 Version_t vers = b.ReadVersion(&start, &count, cle);                 Version_t vers = b.ReadVersion(&start, &count, cle);
                TClass *newClass = aElement->GetNewClass();  
                TClass *oldClass = aElement->GetClassPointer();  
1141    
1142                 if ( vers & TBufferFile::kStreamedMemberWise ) {                 if ( vers & TBufferFile::kStreamedMemberWise ) {
1143                    // Collection was saved member-wise                    // Collection was saved member-wise
1144                    vers &= ~( TBufferFile::kStreamedMemberWise );                    vers &= ~( TBufferFile::kStreamedMemberWise );
1145    
1146                      TClass *newClass = aElement->GetNewClass();
1147                      TClass *oldClass = aElement->GetClassPointer();
1148    
1149                    if( vers < 8 && newClass && newClass!=oldClass ) {                    if( vers < 8 && newClass && newClass!=oldClass ) {
1150                       Error( "ReadBuffer", "Due to a bug this fill does not contain information necessary to do Schema Evolution, sorry :(" );                       Error( "ReadBuffer", "Unfortunately, version %d of TStreamerInfo (used in %s) did not record enough information to convert a %d into a %s.",
1151                               vers, b.GetParent() ? b.GetParent()->GetName() : "memory/socket", oldClass->GetName(), newClass->GetName() );
1152                       continue;                       continue;
1153                    }                    }
1154                      UInt_t startDummy, countDummy;
1155                    Version_t vClVersion = 0; // For vers less than 8, we have to use the current version.                    Version_t vClVersion = 0; // For vers less than 8, we have to use the current version.
1156                    if( vers >= 8 ) {                    if( vers >= 8 ) {
1157                       vClVersion = b.ReadVersion( &startDummy, &countDummy, cle->GetCollectionProxy()->GetValueClass() );                       vClVersion = b.ReadVersion( &startDummy, &countDummy, cle->GetCollectionProxy()->GetValueClass() );

Legend:
Removed from v.33173  
changed lines
  Added in v.33174

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9