37 fBranchVector.reserve( 25 );
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 );
165 BranchMap_t::iterator brIter;
167 (*brIter).second.fPointers->clear();
179 Int_t totalBytes = 0;
189 Error(
"Fill",
"The IO error while writing the indices!");
202 Error(
"Fill",
"The IO error while writing the branch %s!", br->
GetName() );
235 std::vector<void*>* elPointers = 0;
241 Int_t totalBytes = 0;
245 for(
UInt_t i = 0; i < size; ++i ) {
268 std::string vectClName(
"vector<");
269 vectClName += actClass->
GetName() + std::string(
"*>");
272 Warning(
"Fill",
"Unable to find dictionary for class %s", vectClName.c_str() );
282 elPointers =
new std::vector<void*>();
303 brIter =
fBranchMap.insert(std::make_pair(actClass, bHelper ) ).first;
304 elBranch->
SetAddress( &((*brIter).second.fPointers) );
311 elPointers = (*brIter).second.fPointers;
312 elBranch = (*brIter).second.fBranch;
313 elID = (*brIter).second.fId;
314 elOffset = (*brIter).second.fBaseOffset;
321 elPointers->push_back( element + elOffset );
331 Error(
"Fill",
"The IO error while writing the indices!");
344 Error(
"Fill",
"The IO error while writing the branch %s!", br->
GetName() );
381 Error(
"GetEntry",
"No collection proxy!" );
390 Int_t totalBytes = 0;
398 Error(
"GetEntry",
"IO error! Unable to get the indices!" );
432 std::vector<void*>* elemVect = 0;
435 for(
Int_t i = 0; i < size; ++i ) {
452 if( index > nBranches ) {
453 Error(
"GetEntry",
"Index %d out of range, unable to find the branch, setting pointer to 0",
469 bytes = elemBranch->
GetEntry( entry, getall );
472 Error(
"GetEntry",
"No entry for index %d, setting pointer to 0", index );
479 Error(
"GetEntry",
"I/O error while getting entry for index %d, setting pointer to 0", index );
497 if (tmpClass && elClass) {
512 *element = ((
char*)(*elemVect)[
fBranchVector[index].fPosition++])
551 if (!expectedClass) {
556 Error(
"GetExpectedType",
"Did not find the type for %s",
GetName());
590 for(
Int_t i = -1; i < ninfos; ++i ) {
624 if (strncmp(option,
"debugAddress",strlen(
"debugAddress"))==0) {
633 Printf(
"%-16s %2d SplitCollPtr %-16s %-16s %8x %-16s n/a\n",
634 info ? info->
GetName() :
"StreamerInfo unvailable",
fID,
636 (branchOffset && parent && ind>=0) ? branchOffset[ind] : 0,
640 br->
Print(
"debugAddressSub");
642 }
else if (strncmp(option,
"debugInfo",strlen(
"debugInfo"))==0) {
649 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)
void(TBranch::* ReadLeaves_t)(TBuffer &b)
After being read, the buffer will not be unziped.
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.
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.
void(TBranch::* FillLeaves_t)(TBuffer &b)
Pointer to the ReadLeaves implementation to use.
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)
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.