36 fBranchVector.reserve( 25 );
136 BranchMap_t::iterator brIter;
138 (*brIter).second.fPointers->clear();
139 delete (*brIter).second.fPointers;
150 TList persistentBranches;
153 while( (branch = (
TBranch*)iB()) )
154 persistentBranches.
Add(branch);
155 persistentBranches.
Browse( b );
164 BranchMap_t::iterator brIter;
166 (*brIter).second.fPointers->clear();
178 Int_t totalBytes = 0;
188 Error(
"Fill",
"The IO error while writing the indices!");
201 Error(
"Fill",
"The IO error while writing the branch %s!", br->
GetName() );
234 std::vector<void*>* elPointers = 0;
240 Int_t totalBytes = 0;
244 for(
UInt_t i = 0; i < size; ++i ) {
267 std::string vectClName(
"vector<");
268 vectClName += actClass->
GetName() + std::string(
"*>");
271 Warning(
"Fill",
"Unable to find dictionary for class %s", vectClName.c_str() );
281 elPointers =
new std::vector<void*>();
302 brIter =
fBranchMap.insert(std::make_pair(actClass, bHelper ) ).first;
303 elBranch->
SetAddress( &((*brIter).second.fPointers) );
310 elPointers = (*brIter).second.fPointers;
311 elBranch = (*brIter).second.fBranch;
312 elID = (*brIter).second.fId;
313 elOffset = (*brIter).second.fBaseOffset;
320 elPointers->push_back( element + elOffset );
330 Error(
"Fill",
"The IO error while writing the indices!");
343 Error(
"Fill",
"The IO error while writing the branch %s!", br->
GetName() );
380 Error(
"GetEntry",
"No collection proxy!" );
389 Int_t totalBytes = 0;
397 Error(
"GetEntry",
"IO error! Unable to get the indices!" );
431 std::vector<void*>* elemVect = 0;
434 for(
Int_t i = 0; i < size; ++i ) {
451 if( index > nBranches ) {
452 Error(
"GetEntry",
"Index %d out of range, unable to find the branch, setting pointer to 0",
468 bytes = elemBranch->
GetEntry( entry, getall );
471 Error(
"GetEntry",
"No entry for index %d, setting pointer to 0", index );
478 Error(
"GetEntry",
"I/O error while getting entry for index %d, setting pointer to 0", index );
496 if (tmpClass && elClass) {
511 *element = ((
char*)(*elemVect)[
fBranchVector[index].fPosition++])
550 if (!expectedClass) {
555 Error(
"GetExpectedType",
"Did not find the type for %s",
GetName());
589 for(
Int_t i = -1; i < ninfos; ++i ) {
623 if (strncmp(option,
"debugAddress",strlen(
"debugAddress"))==0) {
632 Printf(
"%-16s %2d SplitCollPtr %-16s %-16s %8x %-16s n/a\n",
633 info ? info->
GetName() :
"StreamerInfo unvailable",
fID,
635 (branchOffset && parent && ind>=0) ? branchOffset[ind] : 0,
639 br->
Print(
"debugAddressSub");
641 }
else if (strncmp(option,
"debugInfo",strlen(
"debugInfo"))==0) {
648 subbranch->
Print(
"debugInfoSub");
Describe Streamer information for one class version.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Check if we should be doing this at all.
virtual void Print(Option_t *option="") const
Print branch parameters.
TVirtualCollectionProxy * GetCollectionProxy()
Return the collection proxy describing the branch content, if any.
virtual void * Allocate(UInt_t n, Bool_t forceDelete)=0
TString fContName
Indices.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual TClass * GetValueClass() const =0
virtual void SetName(const char *name)
Change (i.e.
virtual void SetFirstEntry(Long64_t entry)
set the first entry number (case of TBranchSTL)
virtual void Commit(void *)=0
virtual void Print(Option_t *option="") const
Print TBranch parameters.
Buffer base class used for serializing objects.
virtual void SetAddress(void *addobj)
Point this branch at an object.
Int_t GetEntriesFast() const
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
TIndArray fInd
Class of the ind array.
Bool_t IsVersioned() const
virtual TClass * GetCollectionClass() const
Int_t fID
Pointer to object at address or the.
const char * Data() const
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
virtual Bool_t IsFolder() const
Branch declared folder if at least one entry.
virtual void SetAddress(void *addr)
We are the top level branch.
void ReadLeavesImpl(TBuffer &b)
Pointer to the FillLeaves implementation to use.
void ClearAndResize(UInt_t size)
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
TClass * fIndArrayCl
Parent of this branch.
virtual Bool_t IsaPointer() const
const Int_t kDoNotProcess
TObjArray * GetListOfBranches()
TClass * GetClass() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of a BranchElement and return total number of bytes.
virtual ~TBranchSTL()
Destructor.
Int_t GetClassVersion() const
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Int_t fSplitLevel
Number of baskets in memory.
virtual Int_t Fill()
Loop on all leaves of this branch to fill Basket buffer.
TObject * UncheckedAt(Int_t i) const
Using a TBrowser one can browse all ROOT objects.
void(TBranch::* ReadLeaves_t)(TBuffer &b)
After being read, the buffer will not be unziped.
virtual void ls(Option_t *option="") const
Print the content of the element.
void FillLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to fill Basket buffer.
Int_t IndexOf(const TObject *obj) const
TObjArray * GetElements() const
TVirtualCollectionProxy * fCollProxy
Branch vector.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
const char * GetTypeNameBasic() const
Return type name of this element in case the type name is not a standard basic type, return the basic type name known to CINT.
TDirectory * GetDirectory() const
TBranch * GetMother() const
Get our top-level parent branch in the tree.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t TestBit(UInt_t f) const
virtual void * New() const
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
Int_t * GetBranchOffset() const
A Branch for the case of an object.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
void SetNumItems(UInt_t items)
std::vector< void * > * fPointers
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
virtual void * At(UInt_t idx)=0
char * fObject
The streamer info.
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
TDirectory * fDirectory
Address of 1st leaf (variable or 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.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
A Branch handling STL collection of pointers (vectors, lists, queues, sets and multisets) while stori...
virtual UInt_t Size() const =0
TBranch * fParent
Collection proxy.
virtual TStreamerInfo * GetInfo() const
Check if we don't have the streamer info.
virtual void Add(TObject *obj)
void(TBranch::* FillLeaves_t)(TBuffer &b)
Pointer to the ReadLeaves implementation to use.
TBranch * fMother
Pointer to Tree header.
TStreamerElement * GetElement(Int_t id) const
std::vector< ElementBranchHelper_t > fBranchVector
Branch map.
const TObjArray * GetStreamerInfos() const
A TTree object has a header with a name and a title.
virtual void Browse(TBrowser *b)
Browse a STL branch.
virtual Int_t Fill()
Cleanup after revious fill.
TObject * At(Int_t idx) const
A TTree is a list of TBranches.
Abstract Interface class describing Streamer information for one class.
TString fFileName
Pointer to directory where this branch buffers are stored.
virtual void Print(Option_t *) const
Print the branch parameters.
ClassImp(TBranchSTL) TBranchSTL
Default constructor.
virtual UInt_t GetCheckSum() const =0
char * fAddress
Pointer to parent branch.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.