Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
17class TTree;
19class TStreamerInfo;
20class TBranchElement;
21
22class 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 void Browse( TBrowser *b ) override;
34 Bool_t IsFolder() const override;
35 const char *GetClassName() const override { return fClassName.Data(); }
36 Int_t GetExpectedType(TClass *&clptr,EDataType &type) override;
37 Int_t GetEntry(Long64_t entry = 0, Int_t getall = 0) override;
38 virtual TStreamerInfo *GetInfo() const;
39 void Print(Option_t* = "") const override;
40 void SetAddress(void* addr) override;
41
42 ClassDefOverride(TBranchSTL, 1) //Branch handling STL collection of pointers
43
44 private:
45
46 void ReadLeavesImpl( TBuffer& b );
47 void FillLeavesImpl( TBuffer& b );
48 Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *) override;
49
51 {
53 fBranch(nullptr), fPointers(nullptr), 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
#define b(i)
Definition RSha256.hxx:100
int Int_t
Definition RtypesCore.h:45
unsigned char UChar_t
Definition RtypesCore.h:38
long long Long64_t
Definition RtypesCore.h:80
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
EDataType
Definition TDataType.h:28
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:110
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:22
Int_t GetExpectedType(TClass *&clptr, EDataType &type) override
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
void Browse(TBrowser *b) override
Browse an STL branch.
virtual ~TBranchSTL()
Destructor.
Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *) override
Fill an STL branch.
void ReadLeavesImpl(TBuffer &b)
Read leaves.
TClass * fIndArrayCl
! Class of the ind array
Definition TBranchSTL.h:69
TBranchSTL()
Default constructor.
void FillLeavesImpl(TBuffer &b)
Fill leaves.
void Print(Option_t *="") const override
Print the branch parameters.
Int_t fClassVersion
Version number of the class.
Definition TBranchSTL.h:73
TString fClassName
Name of the parent class, if we're the data member.
Definition TBranchSTL.h:72
char * fObject
! Pointer to object at address or the
Definition TBranchSTL.h:76
TBranch * fParent
! Parent of this branch
Definition TBranchSTL.h:68
TString fContName
Class name of referenced object.
Definition TBranchSTL.h:71
virtual TStreamerInfo * GetInfo() const
Get streamer info.
TStreamerInfo * fInfo
! The streamer info
Definition TBranchSTL.h:75
TIndArray fInd
! Indices
Definition TBranchSTL.h:70
Int_t fID
Element serial number in the streamer info.
Definition TBranchSTL.h:77
UInt_t fClCheckSum
Class checksum.
Definition TBranchSTL.h:74
Bool_t IsFolder() const override
Branch declared folder if at least one entry.
TVirtualCollectionProxy * fCollProxy
! Collection proxy
Definition TBranchSTL.h:67
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
Get entry.
void SetAddress(void *addr) override
Set Address.
BranchMap_t fBranchMap
! Branch map
Definition TBranchSTL.h:64
std::vector< ElementBranchHelper_t > fBranchVector
! Branch vector
Definition TBranchSTL.h:65
const char * GetClassName() const override
Return the name of the user class whose content is stored in this branch, if any.
Definition TBranchSTL.h:35
std::map< TClass *, ElementBranchHelper_t > BranchMap_t
Definition TBranchSTL.h:63
A TTree is a list of TBranches.
Definition TBranch.h:89
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Buffer base class used for serializing objects.
Definition TBuffer.h:43
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
Describes a persistent version of a class.
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:380
A TTree represents a columnar dataset.
Definition TTree.h:79
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Definition tree.py:1
std::vector< void * > * fPointers
Definition TBranchSTL.h:57