|
ROOT
Reference Guide |
|
Go to the documentation of this file.
12 #ifndef ROOT_TStreamerInfo
13 #define ROOT_TStreamerInfo
39 namespace ROOT {
namespace Detail {
class TCollectionProxyInfo; } }
40 namespace ROOT {
class TSchemaRule; }
245 void *
New(
void *obj = 0);
virtual void Update(const TClass *oldClass, TClass *newClass)
function called by the TClass constructor when replacing an emulated class by the real class
Bool_t MatchLegacyCheckSum(UInt_t checksum) const
Return true if the checksum passed as argument is one of the checksum value produced by the older che...
UInt_t GenerateIncludes(FILE *fp, char *inclist, const TList *extrainfos)
Add to the header file, the #include need for this class.
void AddWriteTextAction(TStreamerInfoActions::TActionSequence *writeSequence, Int_t index, TCompInfo *compinfo)
Int_t fNVirtualInfoLoc
! Number of virtual info location to update.
TStreamerInfoActions::TActionSequence * fReadMemberWise
! List of read action resulting from the compilation for use in member wise streaming.
Abstract base class for accessing the data-members of a class.
TStreamerElement * GetElement(Int_t id) const
TStreamerElement * GetStreamerElement(const char *datamember, Int_t &offset) const
Return the StreamerElement of "datamember" inside our class or any of its base classes.
TStreamerElement * fElem
Not Owned.
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.
Int_t fNdata
!number of optimized elements
Int_t GetDataMemberOffset(TDataMember *dm, TMemberStreamer *&streamer) const
Compute data member offset.
virtual TClassStreamer * GenExplicitClassStreamer(const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl)
Generate class streamer from static functions.
void InsertArtificialElements(std::vector< const ROOT::TSchemaRule * > &rules)
Insert new members as expressed in the array of TSchemaRule(s).
TStreamerInfoActions::TActionSequence * fWriteMemberWise
! List of write action resulting from the compilation for use in member wise streaming.
void DestructorImpl(void *p, Bool_t dtorOnly)
Internal part of the destructor.
virtual TVirtualStreamerInfo * GenerateInfoForPair(const std::string &pairclassname, bool silent, size_t hint_pair_offset, size_t hint_pair_size)
Int_t WriteBufferSTLPtrs(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc, Int_t first, Int_t eoffset)
Write for STL container.
TStreamerInfo(const TStreamerInfo &)=delete
void BuildEmulated(TFile *file)
Create an Emulation TStreamerInfo object.
TCompInfo ** fCompOpt
![fNdata]
Int_t fSize
!size of the persistent 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.
All ROOT classes may have RTTI (run time type identification) support added.
T GetTypedValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Return value of element i in object number j in a TClonesArray and eventually element k in a sub-arra...
Int_t ReadBufferConv(TBuffer &b, const T &arrptr, const TCompInfo *compinfo, Int_t kase, TStreamerElement *aElement, Int_t narr, Int_t eoffset)
Convert elements of a TClonesArray.
TStreamerInfoActions::TActionSequence * GetWriteMemberWiseActions(Bool_t forCollection)
TStreamerInfoActions::TActionSequence * fReadText
! List of text read action resulting from the compilation, used for JSON.
Int_t GetEntries() const
Return the number of objects in array (i.e.
TStreamerInfoActions::TActionSequence * GetReadTextActions()
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
void TagFile(TFile *fFile)
Mark the classindex of the current file as using this TStreamerInfo.
Double_t GetValue(char *pointer, Int_t i, Int_t j, Int_t len) const
virtual Bool_t BuildFor(const TClass *cl)
Check if we can build this for foreign class - do we have some rules to do that.
TMemberStreamer * fStreamer
Not Owned.
Buffer base class used for serializing objects.
TStreamerInfoActions::TActionSequence * GetWriteObjectWiseActions()
TObject * At(Int_t idx) const
void * New(void *obj=0)
An emulated object is created at address obj, if obj is null we allocate memory for the object.
static TStreamerElement * GetCurrentElement()
static function returning a pointer to the current TStreamerElement fgElement points to the current T...
Int_t GetNewType(Int_t id) const
TClass * fClass
Not Owned.
void AddReadMemberWiseVecPtrAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read action for the given element.
Int_t GetElementOffset(Int_t id) const
void Build(Bool_t isTransient=kFALSE)
Build the I/O data structure for the current class version.
void Update(const TClass *oldcl, TClass *newcl)
Update the TClass pointer cached in this object.
Abstract Interface class describing Streamer information for one class.
void PrintValueSTL(const char *name, TVirtualCollectionProxy *cont, Int_t i, Int_t eoffset, Int_t lenmax=1000) const
Print value of element i in a TClonesArray.
TStreamerInfoActions::TActionSequence * fReadMemberWiseVecPtr
! List of read action resulting from the compilation for use in member wise streaming.
TStreamerInfoActions::TActionSequence * fWriteText
! List of text write action resulting for the compilation, used for JSON.
TObjArray * fElements
Array of TStreamerElements.
Int_t fNslots
!total numbrer of slots in fComp.
virtual TVirtualCollectionProxy * GenEmulatedProxy(const char *class_name, Bool_t silent)
Generate emulated collection proxy for a given class.
TStreamerInfo & operator=(const TStreamerInfo &)=delete
void Clear(Option_t *)
If opt contains 'built', reset this StreamerInfo as if Build or BuildOld was never called on it (usef...
TStreamerInfoActions::TActionSequence * GetReadObjectWiseActions()
Int_t ReadBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset)
Read for TClonesArray.
virtual TClassStreamer * GenEmulatedClassStreamer(const char *class_name, Bool_t silent)
Generate emulated class streamer for a given collection class.
void DeleteArray(void *p, Bool_t dtorOnly=kFALSE)
Destroy an array of emulated objects, with optional delete.
Int_t fNfulldata
!number of elements
void ComputeSize()
Compute total size of all persistent elements of the class.
void ForceWriteInfo(TFile *file, Bool_t force=kFALSE)
Recursively mark streamer infos for writing to a file.
char * operator[](UInt_t idx) const
Int_t WriteBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset)
Write for ClonesArray ('first' is an id between -1 and fNfulldata).
void SetOnFileClassVersion(Int_t vers)
void AddWriteAction(TStreamerInfoActions::TActionSequence *writeSequence, Int_t index, TCompInfo *compinfo)
Bool_t CompareContent(TClass *cl, TVirtualStreamerInfo *info, Bool_t warn, Bool_t complete, TFile *file)
Return True if the current StreamerInfo in cl or info is equivalent to this TStreamerInfo.
Int_t GetOnFileClassVersion() const
ULong_t GetMethod(Int_t id) const
Double_t GetValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
void GenerateDeclaration(FILE *fp, FILE *sfp, const TList *subClasses, Bool_t top=kTRUE)
Write the Declaration of class.
TObjArray * GetElements() const
Describe Streamer information for one class version.
UInt_t fCheckSum
Checksum of original class.
void CallShowMembers(const void *obj, TMemberInspector &insp, Bool_t isTransient) const
Emulated a call ShowMembers() on the obj of this class type, passing insp and parent.
Int_t GenerateHeaderFile(const char *dirname, const TList *subClasses=0, const TList *extrainfos=0)
Generate header file for the class described by this TStreamerInfo the function is called by TFile::M...
void SetClass(TClass *cl)
Replace the TClass this streamerInfo is pointing to (belongs to)
void AddReadTextAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read text action for the given element.
Int_t WriteBufferAux(TBuffer &b, const T &arr, TCompInfo *const *const compinfo, Int_t first, Int_t last, Int_t narr, Int_t eoffset, Int_t mode)
The object at pointer is serialized to the buffer b if (arrayMode & 1) ptr is a pointer to array of p...
TStreamerInfoActions::TActionSequence * GetReadMemberWiseActions(Bool_t forCollection)
Int_t GetOffset(Int_t id) const
@ kUChar
Equal to TDataType's kchar.
TVirtualCollectionProxy * fProxy
TClass * fClass
!pointer to class
TStreamerInfoActions::TActionSequence * fWriteMemberWiseVecPtr
! List of write action resulting from the compilation for use in member wise streaming.
void SetCheckSum(UInt_t checksum)
virtual void * At(UInt_t idx)=0
Double_t GetValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
void AddReadAction(TStreamerInfoActions::TActionSequence *readSequence, Int_t index, TCompInfo *compinfo)
Add a read action for the given element.
@ kNeedObjectForVirtualBaseClass
TClass * GetClass() const
TStreamerElement * GetElem(Int_t id) const
UInt_t GetCheckSum() const
Int_t GetSize() const
Return total size of all persistent elements of the class (with offsets).
TPointerCollectionAdapter(TVirtualCollectionProxy *proxy)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
TStreamerInfo()
Default ctor.
TStreamerInfoActions::TActionSequence * fReadObjectWise
! List of read action resulting from the compilation.
Int_t GetClassVersion() const
Int_t ReadBuffer(TBuffer &b, const T &arrptr, TCompInfo *const *const compinfo, Int_t first, Int_t last, Int_t narr=1, Int_t eoffset=0, Int_t mode=0)
Deserialize information from buffer b into object at pointer if (arrayMode & 1) ptr is a pointer to a...
TClass * fNewClass
Not Owned.
Int_t fOnFileClassVersion
!Class version identifier as stored on file.
void SetClassVersion(Int_t vers)
Int_t fClassVersion
Class version identifier.
virtual ~TStreamerInfo()
TStreamerInfo dtor.
Double_t GetValueSTLP(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
@ kArtificial
Cache the value in memory than is not part of the object but is accessible via a SchemaRule.
void PrintValue(const char *name, char *pointer, Int_t i, Int_t len, Int_t lenmax=1000) const
print value of element i in object at pointer The function may be called in two ways: -method1 len < ...
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).
Int_t GetSizeElements() const
Return total size of all persistent elements of the class use GetSize if you want to get the real siz...
TClass instances represent classes, structs and namespaces in the ROOT type system.
Int_t fNumber
!Unique identifier
TStreamerInfoActions::TActionSequence * fWriteObjectWise
! List of write action resulting from the compilation.
static T GetTypedValueAux(Int_t type, void *ladd, int k, Int_t len)
Get the value from inside a collection.
Int_t GetLength(Int_t id) const
void Destructor(void *p, Bool_t dtorOnly=kFALSE)
Emulated destructor for this class.
Mother of all ROOT objects.
#define ClassDef(name, id)
TVirtualStreamerInfo * NewInfo(TClass *cl)
void BuildOld()
rebuild the TStreamerInfo structure
Version_t GetOldVersion() const
TStreamerInfoActions::TActionSequence * GetWriteTextActions()
virtual TVirtualCollectionProxy * GenExplicitProxy(const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl)
Generate proxy from static functions.
void Compile()
loop on the TStreamerElement list regroup members with same type Store predigested information into l...
Int_t GetOffset(const char *) const
Return the offset of the data member as indicated by this StreamerInfo.
void PrintValueClones(const char *name, TClonesArray *clones, Int_t i, Int_t eoffset, Int_t lenmax=1000) const
Print value of element i in a TClonesArray.
void ls(Option_t *option="") const
List the TStreamerElement list and also the precomputed tables if option contains the string "incOrig...
Int_t ReadBufferArtificial(TBuffer &b, const T &arrptr, TStreamerElement *aElement, Int_t narr, Int_t eoffset)
Handle Artificial StreamerElement.
TStreamerElement * GetStreamerElementReal(Int_t i, Int_t j) const
Obsolete: this routine is obsolete and should not longer be used.
T GetTypedValue(char *pointer, Int_t i, Int_t j, Int_t len) const
Return value of element i in object at pointer.
TCompInfo * fComp
![fNslots with less than fElements->GetEntries()*1.5 used] Compiled info
Int_t GetNelement() const
An array of clone (identical) objects.
static 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 cal...
void BuildCheck(TFile *file=0, Bool_t load=kTRUE)
Check if built and consistent with the class dictionary.
Int_t WriteBuffer(TBuffer &b, char *pointer, Int_t first)
General Write.
Version_t fOldVersion
! Version of the TStreamerInfo object read from the file
Int_t WriteBufferSTL(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc)
Write for STL container. ('first' is an id between -1 and fNfulldata).
TClass * GetActualClass(const void *obj) const
Assuming that obj points to (the part of) an object that is of the type described by this streamerInf...
TCompInfo ** fCompFull
![fElements->GetEntries()]
static std::atomic< Int_t > fgCount
Number of TStreamerInfo instances.
T GetTypedValueSTLP(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Return value of element i in object number j in a TClonesArray and eventually element k in a sub-arra...
T GetTypedValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Int_t GetType(Int_t id) const
ULong_t * fVirtualInfoLoc
![fNVirtualInfoLoc] Location of the pointer to the TStreamerInfo inside the object (when emulated)
void * NewArray(Long_t nElements, void *ary=0)
An array of emulated objects is created at address ary, if ary is null, we allocate memory for the ar...