Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TBranchSTL.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/tree:$Id$
0002 // author: Lukasz Janyst <ljanyst@cern.ch>
0003 
0004 //------------------------------------------------------------------------------
0005 // file:   TBranchSTL.h
0006 //------------------------------------------------------------------------------
0007 
0008 #ifndef ROOT_TBranchSTL
0009 #define ROOT_TBranchSTL
0010 
0011 #include "TBranch.h"
0012 #include "TIndArray.h"
0013 
0014 #include <map>
0015 #include <vector>
0016 
0017 class TTree;
0018 class TVirtualCollectionProxy;
0019 class TStreamerInfo;
0020 class TBranchElement;
0021 
0022 class TBranchSTL: public TBranch {
0023    public:
0024       TBranchSTL();
0025       TBranchSTL( TTree* tree, const char* name,
0026                   TVirtualCollectionProxy* collProxy,
0027                   Int_t buffsize, Int_t splitlevel );
0028       TBranchSTL( TBranch* parent, const char* name,
0029                   TVirtualCollectionProxy* collProxy,
0030                   Int_t buffsize, Int_t splitlevel,
0031                   TStreamerInfo* info, Int_t id );
0032       ~TBranchSTL() override;
0033               void           Browse( TBrowser *b ) override;
0034               bool           IsFolder() const override;
0035               const char    *GetClassName() const override { return fClassName.Data(); }
0036               Int_t          GetExpectedType(TClass *&clptr,EDataType &type) override;
0037               Int_t          GetEntry(Long64_t entry = 0, Int_t getall = 0) override;
0038       virtual TStreamerInfo *GetInfo() const;
0039               void           Print(Option_t* = "") const override;
0040               void           SetAddress(void* addr) override;
0041 
0042       ClassDefOverride(TBranchSTL, 1) //Branch handling STL collection of pointers
0043 
0044    private:
0045 
0046       void ReadLeavesImpl( TBuffer& b );
0047       void FillLeavesImpl( TBuffer& b );
0048               Int_t          FillImpl(ROOT::Internal::TBranchIMTHelper *) override;
0049 
0050       struct ElementBranchHelper_t
0051       {
0052          ElementBranchHelper_t():
0053             fBranch(nullptr), fPointers(nullptr), fId(0),
0054             fBaseOffset(0), fPosition(0) {}
0055 
0056          TBranchElement*     fBranch;
0057          std::vector<void*>* fPointers;
0058          UChar_t             fId;
0059          UInt_t              fBaseOffset;
0060          Int_t               fPosition;
0061       };
0062 
0063       typedef std::map<TClass*, ElementBranchHelper_t> BranchMap_t;
0064       BranchMap_t fBranchMap;                           ///<! Branch map
0065       std::vector<ElementBranchHelper_t> fBranchVector; ///<! Branch vector
0066 
0067       TVirtualCollectionProxy* fCollProxy;    ///<! Collection proxy
0068       TBranch*                 fParent;       ///<! Parent of this branch
0069       TClass*                  fIndArrayCl;   ///<! Class of the ind array
0070       TIndArray                fInd;          ///<! Indices
0071       TString                  fContName;     ///<  Class name of referenced object
0072       TString                  fClassName;    ///<  Name of the parent class, if we're the data member
0073       mutable Int_t            fClassVersion; ///<  Version number of the class
0074       UInt_t                   fClCheckSum;   ///<  Class checksum
0075       mutable TStreamerInfo   *fInfo;         ///<! The streamer info
0076       char*                    fObject;       ///<! Pointer to object at address or the
0077       Int_t                    fID;           ///<  Element serial number in the streamer info
0078 };
0079 
0080 #endif // ROOT_TBranchSTL