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

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

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

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

Legend:
Removed from v.33175  
changed lines
  Added in v.33176

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9