Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/tree:$Id$
2// author: Lukasz Janyst <ljanyst@cern.ch>
5// file: TBranchSTL.h
8#ifndef ROOT_TBranchSTL
9#define ROOT_TBranchSTL
11#include "TBranch.h"
12#include "TIndArray.h"
14#include <map>
15#include <vector>
16#include <utility>
18class TTree;
20class TStreamerInfo;
21class TBranchElement;
23class TBranchSTL: public TBranch {
24 public:
25 TBranchSTL();
26 TBranchSTL( TTree* tree, const char* name,
27 TVirtualCollectionProxy* collProxy,
28 Int_t buffsize, Int_t splitlevel );
29 TBranchSTL( TBranch* parent, const char* name,
30 TVirtualCollectionProxy* collProxy,
31 Int_t buffsize, Int_t splitlevel,
32 TStreamerInfo* info, Int_t id );
33 virtual ~TBranchSTL();
34 virtual void Browse( TBrowser *b );
35 virtual Bool_t IsFolder() const;
36 virtual const char *GetClassName() const { return fClassName.Data(); }
37 virtual Int_t GetExpectedType(TClass *&clptr,EDataType &type);
38 virtual Int_t GetEntry( Long64_t entry = 0, Int_t getall = 0 );
39 virtual TStreamerInfo *GetInfo() const;
40 virtual void Print(Option_t*) const;
41 virtual void SetAddress( void* addr );
43 ClassDef( TBranchSTL, 1 ) //Branch handling STL collection of pointers
45 private:
47 void ReadLeavesImpl( TBuffer& b );
48 void FillLeavesImpl( TBuffer& b );
49 virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *);
52 {
54 fBranch( 0 ), fPointers( 0 ), fId( 0 ),
55 fBaseOffset( 0 ), fPosition( 0 ) {}
58 std::vector<void*>* fPointers;
62 };
64 typedef std::map<TClass*, ElementBranchHelper_t> BranchMap_t;
65 BranchMap_t fBranchMap; ///<! Branch map
66 std::vector<ElementBranchHelper_t> fBranchVector; ///<! Branch vector
68 TVirtualCollectionProxy* fCollProxy; ///<! Collection proxy
69 TBranch* fParent; ///<! Parent of this branch
70 TClass* fIndArrayCl; ///<! Class of the ind array
71 TIndArray fInd; ///<! Indices
72 TString fContName; ///< Class name of referenced object
73 TString fClassName; ///< Name of the parent class, if we're the data member
74 mutable Int_t fClassVersion; ///< Version number of the class
75 UInt_t fClCheckSum; ///< Class checksum
76 mutable TStreamerInfo *fInfo; ///<! The streamer info
77 char* fObject; ///<! Pointer to object at address or the
78 Int_t fID; ///< Element serial number in the streamer info
81#endif // ROOT_TBranchSTL
#define b(i)
Definition: RSha256.hxx:100
int Int_t
Definition: RtypesCore.h:43
unsigned char UChar_t
Definition: RtypesCore.h:36
long long Long64_t
Definition: RtypesCore.h:71
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
Definition: TDataType.h:28
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
A Branch for the case of an object.
A Branch handling STL collection of pointers (vectors, lists, queues, sets and multisets) while stori...
Definition: TBranchSTL.h:23
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
Definition: TBranchSTL.cxx:519
virtual ~TBranchSTL()
Definition: TBranchSTL.cxx:135
void ReadLeavesImpl(TBuffer &b)
Read leaves.
Definition: TBranchSTL.cxx:645
TClass * fIndArrayCl
! Class of the ind array
Definition: TBranchSTL.h:70
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Fill an STL branch.
Definition: TBranchSTL.cxx:163
virtual void Print(Option_t *) const
Print the branch parameters.
Definition: TBranchSTL.cxx:603
Default constructor.
Definition: TBranchSTL.cxx:28
void FillLeavesImpl(TBuffer &b)
Fill leaves.
Definition: TBranchSTL.cxx:653
Int_t fClassVersion
Version number of the class.
Definition: TBranchSTL.h:74
TString fClassName
Name of the parent class, if we're the data member.
Definition: TBranchSTL.h:73
char * fObject
! Pointer to object at address or the
Definition: TBranchSTL.h:77
TBranch * fParent
! Parent of this branch
Definition: TBranchSTL.h:69
TString fContName
Class name of referenced object.
Definition: TBranchSTL.h:72
virtual TStreamerInfo * GetInfo() const
Get streamer info.
Definition: TBranchSTL.cxx:548
TStreamerInfo * fInfo
! The streamer info
Definition: TBranchSTL.h:76
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
Definition: TBranchSTL.h:36
virtual void SetAddress(void *addr)
Set Address.
Definition: TBranchSTL.cxx:661
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Get entry.
Definition: TBranchSTL.cxx:346
virtual void Browse(TBrowser *b)
Browse an STL branch.
Definition: TBranchSTL.cxx:147
TIndArray fInd
! Indices
Definition: TBranchSTL.h:71
virtual Bool_t IsFolder() const
Branch declared folder if at least one entry.
Definition: TBranchSTL.cxx:593
Int_t fID
Element serial number in the streamer info.
Definition: TBranchSTL.h:78
UInt_t fClCheckSum
Class checksum.
Definition: TBranchSTL.h:75
TVirtualCollectionProxy * fCollProxy
! Collection proxy
Definition: TBranchSTL.h:68
BranchMap_t fBranchMap
! Branch map
Definition: TBranchSTL.h:65
std::vector< ElementBranchHelper_t > fBranchVector
! Branch vector
Definition: TBranchSTL.h:66
std::map< TClass *, ElementBranchHelper_t > BranchMap_t
Definition: TBranchSTL.h:64
A TTree is a list of TBranches.
Definition: TBranch.h:91
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:46
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
A TTree represents a columnar dataset.
Definition: TTree.h:78
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21
Definition: tree.py:1
std::vector< void * > * fPointers
Definition: TBranchSTL.h:58