diff --git a/base/inc/TBuffer.h b/base/inc/TBuffer.h index 439d75cb9303eb684d0c6615498709fa9d017ea7..59b5e350f181aef3a17a1386524d377e4d578d8a 100644 --- a/base/inc/TBuffer.h +++ b/base/inc/TBuffer.h @@ -1,4 +1,4 @@ -// @(#)root/base:$Name: $:$Id: TBuffer.h,v 1.56 2007/01/19 16:47:59 brun Exp $ +// @(#)root/base:$Name: $:$Id: TBuffer.h,v 1.57 2007/01/20 19:29:34 brun Exp $ // Author: Rene Brun, Philippe Canal, Fons Rademakers 04/05/96 /************************************************************************* @@ -93,6 +93,7 @@ public: virtual char *ReadString(char *s, Int_t max) = 0; virtual void WriteString(const char *s) = 0; + virtual Int_t GetVersionOwner() const = 0; virtual Int_t GetMapCount() const = 0; virtual void GetMappedObject(UInt_t tag, void* &ptr, TClass* &ClassPtr) const = 0; virtual void MapObject(const TObject *obj, UInt_t offset = 1) = 0; diff --git a/base/inc/TBufferFile.h b/base/inc/TBufferFile.h index 2f20aa8fe08f6725ec55dd3119d85b34d8c18c4a..6f96946531d175887eb1a2f4aef500005e479902 100644 --- a/base/inc/TBufferFile.h +++ b/base/inc/TBufferFile.h @@ -1,4 +1,4 @@ -// @(#)root/base:$Name: $:$Id: TBufferFile.h,v 1.1 2007/01/19 16:47:59 brun Exp $ +// @(#)root/base:$Name: $:$Id: TBufferFile.h,v 1.2 2007/01/20 19:29:34 brun Exp $ // Author: Rene Brun 17/01/2007 /************************************************************************* @@ -103,9 +103,10 @@ public: Bool_t CheckObject(const TObject *obj); Bool_t CheckObject(const void *obj, const TClass *ptrClass); - virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss); - virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname); - virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE); + virtual Int_t GetVersionOwner() const; + virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss); + virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname); + virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE); virtual Version_t ReadVersion(UInt_t *start = 0, UInt_t *bcnt = 0, const TClass *cl = 0); virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE); diff --git a/base/src/TBufferFile.cxx b/base/src/TBufferFile.cxx index 5748346b793396470e4672dd4531633d0f1312f5..f4901de463bf758dfe73f5562770eecfb564ace6 100644 --- a/base/src/TBufferFile.cxx +++ b/base/src/TBufferFile.cxx @@ -1,4 +1,4 @@ -// @(#)root/base:$Name: $:$Id: TBufferFile.cxx,v 1.1 2007/01/19 16:47:59 brun Exp $ +// @(#)root/base:$Name: $:$Id: TBufferFile.cxx,v 1.2 2007/01/20 09:46:36 brun Exp $ // Author: Rene Brun 17/01/2007 /************************************************************************* @@ -143,6 +143,15 @@ TBufferFile::~TBufferFile() } +//______________________________________________________________________________ +Int_t TBufferFile::GetVersionOwner() const +{ + // return the version number of the owner file + TFile *file = (TFile*)GetParent(); + if (file) return file->GetVersion(); + else return 0; +} + //______________________________________________________________________________ void TBufferFile::IncrementLevel(TStreamerInfo* info) { diff --git a/io/inc/TBufferFile.h b/io/inc/TBufferFile.h index 2f20aa8fe08f6725ec55dd3119d85b34d8c18c4a..6f96946531d175887eb1a2f4aef500005e479902 100644 --- a/io/inc/TBufferFile.h +++ b/io/inc/TBufferFile.h @@ -1,4 +1,4 @@ -// @(#)root/base:$Name: $:$Id: TBufferFile.h,v 1.1 2007/01/19 16:47:59 brun Exp $ +// @(#)root/base:$Name: $:$Id: TBufferFile.h,v 1.2 2007/01/20 19:29:34 brun Exp $ // Author: Rene Brun 17/01/2007 /************************************************************************* @@ -103,9 +103,10 @@ public: Bool_t CheckObject(const TObject *obj); Bool_t CheckObject(const void *obj, const TClass *ptrClass); - virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss); - virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname); - virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE); + virtual Int_t GetVersionOwner() const; + virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss); + virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname); + virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE); virtual Version_t ReadVersion(UInt_t *start = 0, UInt_t *bcnt = 0, const TClass *cl = 0); virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE); diff --git a/io/src/TBufferFile.cxx b/io/src/TBufferFile.cxx index 5748346b793396470e4672dd4531633d0f1312f5..f4901de463bf758dfe73f5562770eecfb564ace6 100644 --- a/io/src/TBufferFile.cxx +++ b/io/src/TBufferFile.cxx @@ -1,4 +1,4 @@ -// @(#)root/base:$Name: $:$Id: TBufferFile.cxx,v 1.1 2007/01/19 16:47:59 brun Exp $ +// @(#)root/base:$Name: $:$Id: TBufferFile.cxx,v 1.2 2007/01/20 09:46:36 brun Exp $ // Author: Rene Brun 17/01/2007 /************************************************************************* @@ -143,6 +143,15 @@ TBufferFile::~TBufferFile() } +//______________________________________________________________________________ +Int_t TBufferFile::GetVersionOwner() const +{ + // return the version number of the owner file + TFile *file = (TFile*)GetParent(); + if (file) return file->GetVersion(); + else return 0; +} + //______________________________________________________________________________ void TBufferFile::IncrementLevel(TStreamerInfo* info) {