Logo ROOT  
Reference Guide
TBranchSTL.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // author: Lukasz Janyst <ljanyst@cern.ch>
3 
4 //------------------------------------------------------------------------------
5 // file: TBranchSTL.h
6 //------------------------------------------------------------------------------
7 
8 #ifndef ROOT_TBranchSTL
9 #define ROOT_TBranchSTL
10 
11 #include "TBranch.h"
12 #include "TIndArray.h"
13 
14 #include <map>
15 #include <vector>
16 
17 class TTree;
19 class TStreamerInfo;
20 class TBranchElement;
21 
22 class TBranchSTL: public TBranch {
23  public:
24  TBranchSTL();
25  TBranchSTL( TTree* tree, const char* name,
26  TVirtualCollectionProxy* collProxy,
27  Int_t buffsize, Int_t splitlevel );
28  TBranchSTL( TBranch* parent, const char* name,
29  TVirtualCollectionProxy* collProxy,
30  Int_t buffsize, Int_t splitlevel,
31  TStreamerInfo* info, Int_t id );
32  virtual ~TBranchSTL();
33  virtual void Browse( TBrowser *b );
34  virtual Bool_t IsFolder() const;
35  virtual const char *GetClassName() const { return fClassName.Data(); }
36  virtual Int_t GetExpectedType(TClass *&clptr,EDataType &type);
37  virtual Int_t GetEntry( Long64_t entry = 0, Int_t getall = 0 );
38  virtual TStreamerInfo *GetInfo() const;
39  virtual void Print(Option_t*) const;
40  virtual void SetAddress( void* addr );
41 
42  ClassDef( TBranchSTL, 1 ) //Branch handling STL collection of pointers
43 
44  private:
45 
46  void ReadLeavesImpl( TBuffer& b );
47  void FillLeavesImpl( TBuffer& b );
48  virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *);
49 
51  {
53  fBranch( 0 ), fPointers( 0 ), fId( 0 ),
54  fBaseOffset( 0 ), fPosition( 0 ) {}
55 
57  std::vector<void*>* fPointers;
61  };
62 
63  typedef std::map<TClass*, ElementBranchHelper_t> BranchMap_t;
64  BranchMap_t fBranchMap; ///<! Branch map
65  std::vector<ElementBranchHelper_t> fBranchVector; ///<! Branch vector
66 
67  TVirtualCollectionProxy* fCollProxy; ///<! Collection proxy
68  TBranch* fParent; ///<! Parent of this branch
69  TClass* fIndArrayCl; ///<! Class of the ind array
70  TIndArray fInd; ///<! Indices
71  TString fContName; ///< Class name of referenced object
72  TString fClassName; ///< Name of the parent class, if we're the data member
73  mutable Int_t fClassVersion; ///< Version number of the class
74  UInt_t fClCheckSum; ///< Class checksum
75  mutable TStreamerInfo *fInfo; ///<! The streamer info
76  char* fObject; ///<! Pointer to object at address or the
77  Int_t fID; ///< Element serial number in the streamer info
78 };
79 
80 #endif // ROOT_TBranchSTL
TBranchSTL::fClassName
TString fClassName
Name of the parent class, if we're the data member.
Definition: TBranchSTL.h:72
TBrowser
Definition: TBrowser.h:37
TBranchSTL::fBranchMap
BranchMap_t fBranchMap
! Branch map
Definition: TBranchSTL.h:64
TBranchElement
Definition: TBranchElement.h:39
TBranchSTL::ElementBranchHelper_t::fPosition
Int_t fPosition
Definition: TBranchSTL.h:60
TString::Data
const char * Data() const
Definition: TString.h:369
tree
Definition: tree.py:1
TIndArray
Definition: TIndArray.h:14
TBranch.h
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TBranchSTL::TBranchSTL
TBranchSTL()
Default constructor.
Definition: TBranchSTL.cxx:28
TBranchSTL::fCollProxy
TVirtualCollectionProxy * fCollProxy
! Collection proxy
Definition: TBranchSTL.h:67
TTree
Definition: TTree.h:79
TBranchSTL::ElementBranchHelper_t::fBranch
TBranchElement * fBranch
Definition: TBranchSTL.h:56
TBranchSTL::ElementBranchHelper_t::ElementBranchHelper_t
ElementBranchHelper_t()
Definition: TBranchSTL.h:52
Int_t
int Int_t
Definition: RtypesCore.h:45
TBranchSTL::fParent
TBranch * fParent
! Parent of this branch
Definition: TBranchSTL.h:68
TBranchSTL::BranchMap_t
std::map< TClass *, ElementBranchHelper_t > BranchMap_t
Definition: TBranchSTL.h:63
TBuffer
Definition: TBuffer.h:43
TBranchSTL::fObject
char * fObject
! Pointer to object at address or the
Definition: TBranchSTL.h:76
TBranchSTL
Definition: TBranchSTL.h:22
TString
Definition: TString.h:136
TBranchSTL::fBranchVector
std::vector< ElementBranchHelper_t > fBranchVector
! Branch vector
Definition: TBranchSTL.h:65
b
#define b(i)
Definition: RSha256.hxx:118
bool
TBranchSTL::GetClassName
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
Definition: TBranchSTL.h:35
TBranchSTL::GetEntry
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Get entry.
Definition: TBranchSTL.cxx:346
TBranchSTL::ReadLeavesImpl
void ReadLeavesImpl(TBuffer &b)
Read leaves.
Definition: TBranchSTL.cxx:645
TBranchSTL::fContName
TString fContName
Class name of referenced object.
Definition: TBranchSTL.h:71
TBranch
Definition: TBranch.h:89
TBranchSTL::Browse
virtual void Browse(TBrowser *b)
Browse an STL branch.
Definition: TBranchSTL.cxx:147
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TIndArray.h
TStreamerInfo
Definition: TStreamerInfo.h:44
TBranchSTL::FillImpl
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Fill an STL branch.
Definition: TBranchSTL.cxx:163
TBranchSTL::fInfo
TStreamerInfo * fInfo
! The streamer info
Definition: TBranchSTL.h:75
TBranchSTL::ElementBranchHelper_t::fBaseOffset
UInt_t fBaseOffset
Definition: TBranchSTL.h:59
TBranchSTL::GetInfo
virtual TStreamerInfo * GetInfo() const
Get streamer info.
Definition: TBranchSTL.cxx:548
unsigned int
TBranchSTL::fID
Int_t fID
Element serial number in the streamer info.
Definition: TBranchSTL.h:77
TBranchSTL::fClCheckSum
UInt_t fClCheckSum
Class checksum.
Definition: TBranchSTL.h:74
TBranchSTL::fClassVersion
Int_t fClassVersion
Version number of the class.
Definition: TBranchSTL.h:73
TClass
Definition: TClass.h:80
EDataType
EDataType
Definition: TDataType.h:28
UChar_t
unsigned char UChar_t
Definition: RtypesCore.h:38
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TBranchSTL::~TBranchSTL
virtual ~TBranchSTL()
Destructor.
Definition: TBranchSTL.cxx:135
TBranchSTL::IsFolder
virtual Bool_t IsFolder() const
Branch declared folder if at least one entry.
Definition: TBranchSTL.cxx:593
name
char name[80]
Definition: TGX11.cxx:110
TBranchSTL::GetExpectedType
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
TBranchSTL::SetAddress
virtual void SetAddress(void *addr)
Set Address.
Definition: TBranchSTL.cxx:661
TBranchSTL::fInd
TIndArray fInd
! Indices
Definition: TBranchSTL.h:70
TBranchSTL::ElementBranchHelper_t::fId
UChar_t fId
Definition: TBranchSTL.h:58
TBranchSTL::FillLeavesImpl
void FillLeavesImpl(TBuffer &b)
Fill leaves.
Definition: TBranchSTL.cxx:653
TBranchSTL::fIndArrayCl
TClass * fIndArrayCl
! Class of the ind array
Definition: TBranchSTL.h:69
type
int type
Definition: TGX11.cxx:121
TBranchSTL::ElementBranchHelper_t::fPointers
std::vector< void * > * fPointers
Definition: TBranchSTL.h:57
TBranchSTL::ElementBranchHelper_t
Definition: TBranchSTL.h:50
ROOT
VSD Structures.
Definition: StringConv.hxx:21
TVirtualCollectionProxy
Definition: TVirtualCollectionProxy.h:38
TBranchSTL::Print
virtual void Print(Option_t *) const
Print the branch parameters.
Definition: TBranchSTL.cxx:603
int