library: libCore
#include "TStreamerInfo.h"

TStreamerInfo


class description - header file - source file
viewCVS header - viewCVS source

class TStreamerInfo: public TNamed

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
TStreamerInfo()
TStreamerInfo(TClass* cl, const char* info)
virtual~TStreamerInfo()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
voidBuild()
voidBuildCheck()
voidBuildEmulated(TFile* file)
voidBuildOld()
static Bool_tCanDelete()
static Bool_tCanOptimize()
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t*)
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
voidCompile()
voidComputeSize()
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")
voidDeleteArray(void* p, Bool_t dtorOnly = kFALSE)
voidDestructor(void* p, Bool_t dtorOnly = kFALSE)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
voidForceWriteInfo(TFile* file, Bool_t force = kFALSE)
Int_tGenerateHeaderFile(const char* dirname)
UInt_tGetCheckSum() const
TClass*GetClass() const
Int_tGetClassVersion() const
static TStreamerElement*GetCurrentElement()
Int_tGetDataMemberOffset(TDataMember* dm, TMemberStreamer*& streamer) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
static TStreamerBasicType*GetElementCounter(const char* countName, TClass* cl)
TObjArray*GetElements() const
ULong_t*GetElems() const
virtual const char*TObject::GetIconName() const
Int_t*GetLengths() const
ULong_t*GetMethods() const
virtual const char*TNamed::GetName() const
Int_tGetNdata() const
Int_t*GetNewTypes() const
Int_tGetNumber() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
Int_tGetOffset(const char*) const
Int_t*GetOffsets() const
Version_tGetOldVersion() const
virtual Option_t*TObject::GetOption() const
Int_tGetSize() const
Int_tGetSizeElements() const
TStreamerElement*GetStreamerElement(const char* datamember, Int_t& offset) const
TStreamerElement*GetStreamerElementReal(Int_t i, Int_t j) const
static Bool_tGetStreamMemberWise()
virtual const char*TNamed::GetTitle() const
Int_t*GetTypes() const
virtual UInt_tTObject::GetUniqueID() const
Double_tGetValue(char* pointer, Int_t i, Int_t j, Int_t len) const
Double_tGetValueClones(TClonesArray* clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Double_tGetValueSTL(TVirtualCollectionProxy* cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tIsBuilt() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
Bool_tIsOptimized() const
Int_tIsRecovered() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
void*New(void* obj = 0)
void*NewArray(Long_t nElements, void* ary = 0)
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
static voidOptimize(Bool_t opt = kTRUE)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
voidPrintValue(const char* name, char* pointer, Int_t i, Int_t len, Int_t lenmax = 1000) const
voidPrintValueClones(const char* name, TClonesArray* clones, Int_t i, Int_t eoffset, Int_t lenmax = 1000) const
voidPrintValueSTL(const char* name, TVirtualCollectionProxy* cont, Int_t i, Int_t eoffset, Int_t lenmax = 1000) const
virtual Int_tTObject::Read(const char* name)
Int_tReadBufferClones(TBuffer& b, TClonesArray* clones, Int_t nc, Int_t first, Int_t eoffset)
Int_tReadBufferSTL(TBuffer& b, TVirtualCollectionProxy* cont, Int_t nc, Int_t first, Int_t eoffset)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
static voidSetCanDelete(Bool_t opt = kTRUE)
voidSetCheckSum(UInt_t checksum)
voidSetClass(TClass* cl)
voidSetClassVersion(Int_t vers)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
static Bool_tSetStreamMemberWise(Bool_t enable = kTRUE)
virtual voidTNamed::SetTitle(const char* title = "")
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
voidTagFile(TFile* fFile)
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidUpdate(const TClass* oldClass, TClass* newClass)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) const
Int_tWriteBuffer(TBuffer& b, char* pointer, Int_t first)
Int_tWriteBufferClones(TBuffer& b, TClonesArray* clones, Int_t nc, Int_t first, Int_t eoffset)
Int_tWriteBufferSTL(TBuffer& b, TVirtualCollectionProxy* cont, Int_t nc, Int_t first, Int_t eoffset)
protected:
TStreamerInfo(const TStreamerInfo&)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
TStreamerInfo&operator=(const TStreamerInfo&)
private:
voidBuildUserInfo(const char* info)
static Double_tGetValueAux(Int_t type, void* ladd, int k, Int_t len)
static voidPrintValueAux(char* ladd, Int_t atype, TStreamerElement* aElement, Int_t aleng, Int_t* count)

Data Members

public:
enum { kCannotOptimize
kIgnoreTObjectStreamer
kRecovered
kNeedCheck
};
enum EReadWrite { kBase
kOffsetL
kOffsetP
kCounter
kCharStar
kChar
kShort
kInt
kLong
kFloat
kDouble
kDouble32
kUChar
kUShort
kUInt
kULong
kBits
kLong64
kULong64
kBool
kObject
kAny
kObjectp
kObjectP
kTString
kTObject
kTNamed
kAnyp
kAnyP
kAnyPnoVT
kSTLp
kSkip
kSkipL
kSkipP
kConv
kConvL
kConvP
kSTL
kSTLstring
kStreamer
kStreamLoop
kMissing
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
private:
UInt_tfCheckSumchecksum of original class
Int_tfClassVersionClass version identifier
Int_tfNumber!Unique identifier
Int_tfNdata!number of optmized types
Int_tfSize!size of the persistent class
Int_t*fType![fNdata]
Int_t*fNewType![fNdata]
Int_t*fOffset![fNdata]
Int_t*fLength![fNdata]
ULong_t*fElem![fNdata]
ULong_t*fMethod![fNdata]
TStreamerInfo::TCompInfo*fComp![fNdata] additional info
Bool_tfOptimized! true if has been optimized
TClass*fClass!pointer to class
TObjArray*fElementsArray of TStreamerElements
Version_tfOldVersion! Version of the TStreamerInfo object read from the file
Bool_tfIsBuilt! true if the TStreamerInfo has been 'built'
static Int_tfgCountNumber of TStreamerInfo instances
static Bool_tfgCanDeleteTrue if ReadBuffer can delete object
static Bool_tfgOptimizeTrue if optimization on
static Bool_tfgStreamMemberWiseTrue if the collections are to be stream "member-wise" (when possible).
static TStreamerElement*fgElementPointer to current TStreamerElement

Class Description

                                                                      
                                                                      

TStreamerInfo()
 Default ctor.
TStreamerInfo(TClass *cl, const char *info)
 Create a TStreamerInfo object.
TStreamerInfo(const TStreamerInfo& si)
copy constructor
TStreamerInfo& operator=(const TStreamerInfo& si)
assignement operator
~TStreamerInfo()
 TStreamerInfo dtor.
void Build()
 Build the I/O data structure for the current class version.
 A list of TStreamerElement derived classes is built by scanning
 one by one the list of data members of the analyzed class.
void BuildCheck()
 Check if built and consistent with the class dictionary.
 This method is called by TFile::ReadStreamerInfo.
void BuildEmulated(TFile *file)
 Create an Emulation TStreamerInfo object.
void BuildOld()
 rebuild the TStreamerInfo structure
void BuildUserInfo(const char * /*info*/)
 Build the I/O data structure for the current class version
Bool_t CanDelete()
 static function returning true if ReadBuffer can delete object
Bool_t CanOptimize()
 static function returning true if optimization can be on
void Clear(Option_t *option)
 If opt cointains 'built', reset this StreamerInfo as if Build or BuildOld
 was never called on it (usefull to force their re-running).
void Compile()
 loop on the TStreamerElement list
 regroup members with same type
 Store predigested information into local arrays. This saves a huge amount
 of time compared to an explicit iteration on all elements.
void ComputeSize()
 Compute total size of all persistent elements of the class
void ForceWriteInfo(TFile *file, Bool_t force)
 will force this TStreamerInfo to the file and also
 all the dependencies.
 This function is called when streaming a class that contains
 a null pointer. In this case, the TStreamerInfo for the class
 with the null pointer must be written to the file and also all the
 TStreamerInfo of all the classes referenced by the class.

 if argument force > 0 the loop on class dependencies is forced
Int_t GenerateHeaderFile(const char *dirname)
 Generate header file for the class described by this TStreamerInfo
 the function is called by TFile::MakeProject for each class in the file
TStreamerElement * GetCurrentElement()
static function returning a pointer to the current TStreamerElement
fgElement points to the current TStreamerElement being read in ReadBuffer
Int_t GetDataMemberOffset(TDataMember *dm, TMemberStreamer *&streamer)
 Compute data member offset
 return pointer to the Streamer function if one exists
TStreamerBasicType * GetElementCounter(const char *countName, TClass *cl)
 Get pointer to a TStreamerBasicType in TClass *cl
static function
Int_t GetOffset(const char *elementName)
 return the offset of the data member as indicated by this StreamerInfo
Int_t GetSize()
  return total size of all persistent elements of the class (with offsets)
Int_t GetSizeElements()
  return total size of all persistent elements of the class
  use GetSize if you want to get the real size in memory
TStreamerElement* GetStreamerElement(const char* datamember, Int_t& offset)
 Return the StreamerElement of "datamember" inside our
 class or any of its base classes.  The offset information
 contained in the StreamerElement is related to its immediately
 containing class, so we return in 'offset' the offset inside
 our class.
TStreamerElement* GetStreamerElementReal(Int_t i, Int_t j)
  TStreamerInfo  holds two types of data structures
    -TObjArray* fElements; containing the list of all TStreamerElement
       objects for this class version.
    -ULong_t*  fElem;  containing the preprocessed information
       by TStreamerInfo::Compile In case consecutive data members
       are of the same type, the Compile function declares the consecutive
       elements as one single element in fElems.

  example with the class TAttLine
   gROOT->GetClass("TAttLine")->GetStreamerInfo()->ls(); produces;
      StreamerInfo for class: TAttLine, version=1
       short        fLineColor      offset=  4 type= 2 line color
       short        fLineStyle      offset=  6 type= 2 line style
       short        fLineWidth      offset=  8 type= 2 line width
        i= 0, fLineColor      type= 22, offset=  4, len=3, method=0
  For I/O implementations (eg. XML) , one has to know the original name
  of the data member. This function can be used to return a pointer
  to the original TStreamerElement object corresponding to the j-th
  element of a compressed array in fElems.

  parameters description:
    - i: the serial number in array fElem
    - j: the element number in the array of consecutive types
  In the above example the class TAttLine has 3 consecutive data members
  of the same type "short". Compile makes one single array of 3 elements.
  To access the TStreamerElement for the second element
  of this array, one can call:
     TStreamerElement *el = GetStreamerElementReal(0,1);
     const char* membername = el->GetName();
  This function is typically called from Tbuffer, TXmlBuffer
Bool_t GetStreamMemberWise()
 Return whether the TStreamerInfos will save the collections in
 "member-wise" order whenever possible.    The default is to store member-wise.
 kTRUE indicates member-wise storing
 kFALSE inddicates object-wise storing

 A collection can be saved member wise when it contain is guaranteed to be
 homogeneous.  For example std::vector<THit> can be stored member wise,
 while std::vector<THit*> can not (possible use of polymorphism).
Double_t GetValueAux(Int_t type, void *ladd, Int_t k, Int_t len)
 Get the value from inside a collection.
Double_t GetValue(char *pointer, Int_t i, Int_t j, Int_t len)
  return value of element i in object at pointer.
  The function may be called in two ways:
    -method1  len < 0
           i is assumed to be the TStreamerElement number i in StreamerInfo
    -method2  len >= 0
           i is the type
           address of variable is directly pointer.
Double_t GetValueClones(TClonesArray *clones, Int_t i, Int_t j, int k, Int_t eoffset)
  return value of element i in object number j in a TClonesArray and eventually
 element k in a sub-array.
Double_t GetValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, int k, Int_t eoffset)
  return value of element i in object number j in a TClonesArray and eventually
 element k in a sub-array.
void ls(Option_t *option)
  List the TStreamerElement list and also the precomputed tables
void* New(void *obj)
 An emulated object is created at address obj, if obj is null we
 allocate memory for the object.
void* NewArray(Long_t nElements, void *ary)
 An array of emulated objects is created at address ary, if ary is null,
 we allocate memory for the array.
void Destructor(void* obj, Bool_t dtorOnly)
  emulated destructor for this class.
  An emulated object is destroyed at address p
void DeleteArray(void* ary, Bool_t dtorOnly)
 Destroy an array of emulated objects, with optional delete.
void Optimize(Bool_t opt)
  This is a static function.
  Set optimization option.
  When this option is activated (default), consecutive data members
  of the same type are merged into an array (faster).
  Optimization must be off in TTree split mode.
void PrintValue(const char *name, char *pointer, Int_t i, Int_t len, Int_t lenmax)
  print value of element i in object at pointer
  The function may be called in two ways:
    -method1  len < 0
           i is assumed to be the TStreamerElement number i in StreamerInfo
    -method2  len >= 0
           i is the type
           address of variable is directly pointer.
           len is the number of elements to be printed starting at pointer.
void PrintValueClones(const char *name, TClonesArray *clones, Int_t i, Int_t eoffset, Int_t lenmax)
  print value of element i in a TClonesArray
void PrintValueSTL(const char *name, TVirtualCollectionProxy *cont, Int_t i, Int_t eoffset, Int_t lenmax)
  print value of element i in a TClonesArray
void SetCanDelete(Bool_t opt)
  This is a static function.
  Set object delete option.
  When this option is activated (default), ReadBuffer automatically
  delete objects when a data member is a pointer to an object.
  If your constructor is not presetting pointers to 0, you must
  call this static function TStreamerInfo::SetCanDelete(kFALSE);
Bool_t SetStreamMemberWise(Bool_t enable)
 Set whether the TStreamerInfos will save the collections in
 "member-wise" order whenever possible.  The default is to store member-wise.
 kTRUE indicates member-wise storing
 kFALSE inddicates object-wise storing
 This function returns the previous value of fgStreamMemberWise.
void Streamer(TBuffer &R__b)
 Stream an object of class TStreamerInfo.
void TagFile(TFile *file)
 Mark the classindex of the current file as using this TStreamerInfo
void PrintValueAux(char *ladd, Int_t atype, TStreamerElement *aElement, Int_t aleng, Int_t *count)
  print value of element  in object at pointer, type atype, leng aleng or *count
  The function may be called in two ways:
    -method1  len < 0
           i is assumed to be the TStreamerElement number i in StreamerInfo
    -method2  len >= 0
           i is the type
           address of variable is directly pointer.
           len is the number of elements to be printed starting at pointer.
void Update(const TClass *oldcl, TClass *newcl)
function called by the TClass constructor when replacing an emulated class
by the real class
TClass * GetClass()
{return fClass;}
UInt_t GetCheckSum()
{return fCheckSum;}
Int_t GetClassVersion()
{return fClassVersion;}
TObjArray * GetElements()
{return fElements;}
ULong_t * GetElems()
{return fElem;}
Int_t GetNdata()
{return fNdata;}
Int_t GetNumber()
{return fNumber;}
Int_t * GetLengths()
{return fLength;}
ULong_t * GetMethods()
{return fMethod;}
Int_t * GetNewTypes()
{return fNewType;}
Int_t * GetOffsets()
{return fOffset;}
Version_t GetOldVersion()
{return fOldVersion;}
Int_t * GetTypes()
{return fType;}
Bool_t IsBuilt()
{ return fIsBuilt; }
Bool_t IsOptimized()
{return fOptimized;}
Int_t IsRecovered()
{return TestBit(kRecovered);}
Int_t ReadBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset)
Int_t ReadBufferSTL(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc, Int_t first, Int_t eoffset)
void SetCheckSum(UInt_t checksum)
{fCheckSum = checksum;}
void SetClass(TClass *cl)
{fClass = cl;}
void SetClassVersion(Int_t vers)
{fClassVersion=vers;}
Int_t WriteBuffer(TBuffer &b, char *pointer, Int_t first)
Int_t WriteBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset)

Author: Rene Brun 12/10/2000
Last update: root/meta:$Name: $:$Id: TStreamerInfo.cxx,v 1.245 2006/12/08 17:27:38 pcanal Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.