137 BranchMap_t::iterator brIter;
139 (*brIter).second.fPointers->clear();
140 delete (*brIter).second.fPointers;
151 TList persistentBranches;
154 while( (branch = (
TBranch*)iB()) )
155 persistentBranches.
Add(branch);
156 persistentBranches.
Browse(
b );
168 BranchMap_t::iterator brIter;
170 (*brIter).second.fPointers->clear();
181 Int_t totalBytes = 0;
190 Error(
"Fill",
"The IO error while writing the indices!");
202 Error(
"Fill",
"The IO error while writing the branch %s!", br->
GetName() );
232 std::vector<void*>* elPointers = 0;
238 Int_t totalBytes = 0;
242 for(
UInt_t i = 0; i < size; ++i ) {
263 std::string vectClName(
"vector<");
264 vectClName += actClass->
GetName() + std::string(
"*>");
267 Warning(
"Fill",
"Unable to find dictionary for class %s", vectClName.c_str() );
275 elPointers =
new std::vector<void*>();
297 brIter =
fBranchMap.insert(std::make_pair(actClass, bHelper ) ).first;
298 elBranch->
SetAddress( &((*brIter).second.fPointers) );
304 elPointers = (*brIter).second.fPointers;
305 elBranch = (*brIter).second.fBranch;
306 elID = (*brIter).second.fId;
307 elOffset = (*brIter).second.fBaseOffset;
313 elPointers->push_back( element + elOffset );
322 Error(
"Fill",
"The IO error while writing the indices!");
334 Error(
"Fill",
"The IO error while writing the branch %s!", br->
GetName() );
373 Error(
"GetEntry",
"No collection proxy!" );
381 Int_t totalBytes = 0;
389 Error(
"GetEntry",
"IO error! Unable to get the indices!" );
420 std::vector<void*>* elemVect = 0;
423 for(
Int_t i = 0; i < size; ++i ) {
438 if( index > nBranches ) {
439 Error(
"GetEntry",
"Index %d out of range, unable to find the branch, setting pointer to 0",
454 bytes = elemBranch->
GetEntry( entry, getall );
457 Error(
"GetEntry",
"No entry for index %d, setting pointer to 0", index );
464 Error(
"GetEntry",
"I/O error while getting entry for index %d, setting pointer to 0", index );
481 if (tmpClass && elClass) {
495 *element = ((
char*)(*elemVect)[
fBranchVector[index].fPosition++])
533 if (!expectedClass) {
538 Error(
"GetExpectedType",
"Did not find the type for %s",
GetName());
572 for(
Int_t i = -1; i < ninfos; ++i ) {
605 if (strncmp(option,
"debugAddress",strlen(
"debugAddress"))==0) {
614 Printf(
"%-16s %2d SplitCollPtr %-16s %-16s %8x %-16s n/a\n",
615 info ? info->
GetName() :
"StreamerInfo unvailable",
fID,
617 (branchOffset && parent && ind>=0) ? branchOffset[ind] : 0,
621 br->
Print(
"debugAddressSub");
623 }
else if (strncmp(option,
"debugInfo",strlen(
"debugInfo"))==0) {
630 subbranch->
Print(
"debugInfoSub");
void Printf(const char *fmt,...)
A Branch for the case of an object.
virtual void Print(Option_t *option="") const
Print TBranch parameters.
Int_t * GetBranchOffset() const
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
TVirtualCollectionProxy * GetCollectionProxy()
Return the collection proxy describing the branch content, if any.
virtual void SetAddress(void *addobj)
Point this branch at an object.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of a BranchElement and return total number of bytes.
A Branch handling STL collection of pointers (vectors, lists, queues, sets and multisets) while stori...
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
virtual ~TBranchSTL()
Destructor.
void ReadLeavesImpl(TBuffer &b)
Read leaves.
TClass * fIndArrayCl
! Class of the ind array
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Fill an STL branch.
virtual void Print(Option_t *) const
Print the branch parameters.
TBranchSTL()
Default constructor.
void FillLeavesImpl(TBuffer &b)
Fill leaves.
Int_t fClassVersion
Version number of the class.
TString fClassName
Name of the parent class, if we're the data member.
char * fObject
! Pointer to object at address or the
TBranch * fParent
! Parent of this branch
TString fContName
Class name of referenced object.
virtual TStreamerInfo * GetInfo() const
Get streamer info.
TStreamerInfo * fInfo
! The streamer info
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
virtual void SetAddress(void *addr)
Set Address.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Get entry.
virtual void Browse(TBrowser *b)
Browse an STL branch.
virtual Bool_t IsFolder() const
Branch declared folder if at least one entry.
Int_t fID
Element serial number in the streamer info.
UInt_t fClCheckSum
Class checksum.
TVirtualCollectionProxy * fCollProxy
! Collection proxy
BranchMap_t fBranchMap
! Branch map
std::vector< ElementBranchHelper_t > fBranchVector
! Branch vector
A TTree is a list of TBranches.
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
Int_t fMaxBaskets
Maximum number of Baskets so far.
FillLeaves_t fFillLeaves
! Pointer to the FillLeaves implementation to use.
void(TBranch::* ReadLeaves_t)(TBuffer &b)
char * fAddress
! Address of 1st leaf (variable or object)
TObjArray * GetListOfBranches()
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
ReadLeaves_t fReadLeaves
! Pointer to the ReadLeaves implementation to use.
void(TBranch::* FillLeaves_t)(TBuffer &b)
Int_t fNleaves
! Number of leaves
Int_t fSplitLevel
Branch split level.
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
virtual void Print(Option_t *option="") const
Print TBranch parameters.
friend class TBranchElement
TObjArray fBranches
-> List of Branches of this branch
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
TBranch * fMother
! Pointer to top-level parent branch in the tree.
virtual void SetFirstEntry(Long64_t entry)
set the first entry number (case of TBranchSTL)
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
Long64_t fFirstEntry
Number of the first entry in this branch.
Int_t fBasketSize
Initial Size of Basket Buffer.
Long64_t fEntryNumber
Current entry number (last one filled in this branch)
TBranch * GetMother() const
Get our top-level parent branch in the tree.
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
TTree * fTree
! Pointer to Tree header
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
TClass instances represent classes, structs and namespaces in the ROOT type system.
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
const TObjArray * GetStreamerInfos() const
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Bool_t IsVersioned() const
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
void SetNumItems(UInt_t items)
void ClearAndResize(UInt_t size)
virtual void Add(TObject *obj)
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetName() const
Returns name of object.
Int_t IndexOf(const TObject *obj) const
Int_t GetEntriesFast() const
TObject * UncheckedAt(Int_t i) const
TObject * At(Int_t idx) const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
virtual Bool_t IsaPointer() const
const char * GetTypeNameBasic() const
Return type name of this element in case the type name is not a standard basic type,...
virtual void ls(Option_t *option="") const
Print the content of the element.
Describe Streamer information for one class version.
TObjArray * GetElements() const
TClass * GetClass() const
TStreamerElement * GetElement(Int_t id) const
Int_t GetClassVersion() const
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
A TTree represents a columnar dataset.
TDirectory * GetDirectory() const
virtual void * New() const
virtual TClass * GetValueClass() const =0
virtual void Commit(void *)=0
virtual void * At(UInt_t idx)=0
virtual UInt_t Size() const =0
virtual void * Allocate(UInt_t n, Bool_t forceDelete)=0
virtual TClass * GetCollectionClass() const
Abstract Interface class describing Streamer information for one class.
virtual UInt_t GetCheckSum() const =0
std::vector< void * > * fPointers