ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 "TTree.h"
14 #include "TBrowser.h"
15 #include "TBranchObject.h"
16 #include "TBranchElement.h"
17 #include "TIndArray.h"
18 #include <map>
19 #include <vector>
20 #include <utility>
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 Int_t Fill();
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 );
42 
43  ClassDef( TBranchSTL, 1 ) //Branch handling STL collection of pointers
44 
45  private:
46 
47  void ReadLeavesImpl( TBuffer& b );
48  void FillLeavesImpl( TBuffer& b );
49 
50 #ifndef __CINT__
52  {
54  fBranch( 0 ), fPointers( 0 ), fId( 0 ),
55  fBaseOffset( 0 ), fPosition( 0 ) {}
56 
58  std::vector<void*>* fPointers;
62  };
63 
64  typedef std::map<TClass*, ElementBranchHelper_t> BranchMap_t;
65  BranchMap_t fBranchMap; //! Branch map
66  std::vector<ElementBranchHelper_t> fBranchVector; //! Branch vector
67 #endif // __CINT__
68 
69  TVirtualCollectionProxy* fCollProxy; //! Collection proxy
70  TBranch* fParent; //! Parent of this branch
71  TClass* fIndArrayCl; //! Class of the ind array
72  TIndArray fInd; //! Indices
73  TString fContName; // Class name of referenced object
74  TString fClassName; // Name of the parent class, if we're the data member
75  mutable Int_t fClassVersion; // Version number of the class
76  UInt_t fClCheckSum; // Class checksum
77  mutable TStreamerInfo *fInfo; //! The streamer info
78  char* fObject; //! Pointer to object at address or the
79  Int_t fID; // Element serial number in the streamer info
80 };
81 
82 #endif // ROOT_TBranchSTL
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:47
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Check if we should be doing this at all.
Definition: TBranchSTL.cxx:356
TString fContName
Indices.
Definition: TBranchSTL.h:73
long long Long64_t
Definition: RtypesCore.h:69
ClassDef(TBranch, 12)
const char Option_t
Definition: RtypesCore.h:62
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TStreamerInfo * fInfo
Definition: TBranchSTL.h:77
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:537
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
TIndArray fInd
Class of the ind array.
Definition: TBranchSTL.h:72
Int_t fClassVersion
Definition: TBranchSTL.h:75
Int_t fID
Pointer to object at address or the.
Definition: TBranchSTL.h:79
const char * Data() const
Definition: TString.h:349
virtual Bool_t IsFolder() const
Branch declared folder if at least one entry.
Definition: TBranchSTL.cxx:612
virtual void SetAddress(void *addr)
We are the top level branch.
Definition: TBranchSTL.cxx:680
void ReadLeavesImpl(TBuffer &b)
Pointer to the FillLeaves implementation to use.
Definition: TBranch.cxx:1828
TClass * fIndArrayCl
Parent of this branch.
Definition: TBranchSTL.h:71
UInt_t fClCheckSum
Definition: TBranchSTL.h:76
virtual ~TBranchSTL()
Destructor.
Definition: TBranchSTL.cxx:135
TString fClassName
Definition: TBranchSTL.h:74
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
void FillLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to fill Basket buffer.
Definition: TBranch.cxx:1863
TVirtualCollectionProxy * fCollProxy
Branch vector.
Definition: TBranchSTL.h:69
unsigned int UInt_t
Definition: RtypesCore.h:42
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
BranchMap_t fBranchMap
Definition: TBranchSTL.h:65
Long64_t entry
A Branch for the case of an object.
std::vector< void * > * fPointers
Definition: TBranchSTL.h:58
int type
Definition: TGX11.cxx:120
EDataType
Definition: TDataType.h:30
char * fObject
The streamer info.
Definition: TBranchSTL.h:78
A Branch handling STL collection of pointers (vectors, lists, queues, sets and multisets) while stori...
Definition: TBranchSTL.h:22
TBranch * fParent
Collection proxy.
Definition: TBranchSTL.h:70
virtual TStreamerInfo * GetInfo() const
Check if we don't have the streamer info.
Definition: TBranchSTL.cxx:566
std::vector< ElementBranchHelper_t > fBranchVector
Branch map.
Definition: TBranchSTL.h:66
A TTree object has a header with a name and a title.
Definition: TTree.h:98
virtual void Browse(TBrowser *b)
Browse a STL branch.
Definition: TBranchSTL.cxx:147
unsigned char UChar_t
Definition: RtypesCore.h:34
virtual Int_t Fill()
Cleanup after revious fill.
Definition: TBranchSTL.cxx:163
std::map< TClass *, ElementBranchHelper_t > BranchMap_t
Definition: TBranchSTL.h:64
A TTree is a list of TBranches.
Definition: TBranch.h:58
virtual void Print(Option_t *) const
Print the branch parameters.
Definition: TBranchSTL.cxx:622