TBranchSTL.h

Go to the documentation of this file.
00001 // @(#)root/tree:$Id: TBranchSTL.h 34969 2010-08-24 19:01:19Z pcanal $
00002 // author: Lukasz Janyst <ljanyst@cern.ch>
00003 
00004 //------------------------------------------------------------------------------
00005 // file:   TBranchSTL.h
00006 //------------------------------------------------------------------------------
00007 
00008 #ifndef ROOT_TBranchSTL
00009 #define ROOT_TBranchSTL
00010 
00011 #include "TBranch.h"
00012 #include "TTree.h"
00013 #include "TVirtualCollectionProxy.h"
00014 #include "TBrowser.h"
00015 #include "TBranchObject.h"
00016 #include "TBranchElement.h"
00017 #include "TIndArray.h"
00018 #include <map>
00019 #include <vector>
00020 #include <utility>
00021 
00022 class TBranchSTL: public TBranch {
00023    public:
00024       TBranchSTL();
00025       TBranchSTL( TTree* tree, const char* name,
00026                   TVirtualCollectionProxy* collProxy,
00027                   Int_t buffsize, Int_t splitlevel );
00028       TBranchSTL( TBranch* parent, const char* name,
00029                   TVirtualCollectionProxy* collProxy,
00030                   Int_t buffsize, Int_t splitlevel,
00031                   TStreamerInfo* info, Int_t id );
00032       virtual ~TBranchSTL();
00033       virtual void           Browse( TBrowser *b );
00034       virtual Bool_t         IsFolder() const;
00035       virtual Int_t          Fill();
00036       virtual void           FillLeaves( TBuffer& b );
00037       virtual const char    *GetClassName() const { return fClassName.Data(); }
00038       virtual Int_t          GetEntry( Long64_t entry = 0, Int_t getall = 0 );
00039       virtual TStreamerInfo *GetInfo() const;
00040       virtual void           Print(Option_t*) const;
00041       virtual void           SetAddress( void* addr );
00042 
00043       ClassDef( TBranchSTL, 1 ) //Branch handling STL collection of pointers
00044 
00045    private:
00046 
00047    void ReadLeavesImpl( TBuffer& b );
00048 
00049 #ifndef __CINT__
00050       struct ElementBranchHelper_t
00051       {
00052          ElementBranchHelper_t():
00053             fBranch( 0 ), fPointers( 0 ), fId( 0 ),
00054             fBaseOffset( 0 ), fPosition( 0 ) {}
00055 
00056          TBranchElement*     fBranch;
00057          std::vector<void*>* fPointers;
00058          UChar_t             fId;
00059          UInt_t              fBaseOffset;
00060          Int_t               fPosition;
00061       };
00062 
00063       typedef std::map<TClass*, ElementBranchHelper_t> BranchMap_t;
00064       BranchMap_t fBranchMap;                         //! Branch map
00065       std::vector<ElementBranchHelper_t> fBranchVector; //! Branch vector
00066 #endif // __CINT__
00067 
00068       TVirtualCollectionProxy* fCollProxy;    //! Collection proxy
00069       TBranch*                 fParent;       //! Parent of this branch
00070       TClass*                  fIndArrayCl;   //! Class of the ind array
00071       TIndArray                fInd;          //! Indices
00072       TString                  fContName;     //  Class name of referenced object
00073       TString                  fClassName;    //  Name of the parent class, if we're the data member
00074       mutable Int_t            fClassVersion; //  Version number of the class
00075       UInt_t                   fClCheckSum;   //  Class checksum
00076       mutable TStreamerInfo   *fInfo;         //! The streamer info
00077       char*                    fObject;       //! Pointer to object at address or the
00078       Int_t                    fID;           //  Element serial number in the streamer info
00079 };
00080 
00081 #endif // ROOT_TBranchSTL

Generated on Tue Jul 5 14:26:35 2011 for ROOT_528-00b_version by  doxygen 1.5.1