ROOT logo
// @(#)root/tree:$Id: TBranchSTL.h 31252 2009-11-17 20:12:32Z pcanal $
// author: Lukasz Janyst <ljanyst@cern.ch>

//------------------------------------------------------------------------------
// file:   TBranchSTL.h
//------------------------------------------------------------------------------

#ifndef ROOT_TBranchSTL
#define ROOT_TBranchSTL

#include "TBranch.h"
#include "TTree.h"
#include "TVirtualCollectionProxy.h"
#include "TBrowser.h"
#include "TBranchObject.h"
#include "TBranchElement.h"
#include "TIndArray.h"
#include <map>
#include <vector>
#include <utility>

class TBranchSTL: public TBranch {
   public:
      TBranchSTL();
      TBranchSTL( TTree* tree, const char* name,
                  TVirtualCollectionProxy* collProxy,
                  Int_t buffsize, Int_t splitlevel );
      TBranchSTL( TBranch* parent, const char* name,
                  TVirtualCollectionProxy* collProxy,
                  Int_t buffsize, Int_t splitlevel,
                  TStreamerInfo* info, Int_t id );
      virtual ~TBranchSTL();
      virtual void           Browse( TBrowser *b );
      virtual Bool_t         IsFolder() const;
      virtual Int_t          Fill();
      virtual void           FillLeaves( TBuffer& b );
      virtual const char    *GetClassName() const { return fClassName.Data(); }
      virtual Int_t          GetEntry( Long64_t entry = 0, Int_t getall = 0 );
      virtual TStreamerInfo *GetInfo() const;
      virtual void           Print(Option_t*) const;
      virtual void           ReadLeaves( TBuffer& b );
      virtual void           SetAddress( void* addr );

      ClassDef( TBranchSTL, 1 ) //Branch handling STL collection of pointers

   private:

#ifndef __CINT__
      struct ElementBranchHelper_t
      {
         ElementBranchHelper_t():
            fBranch( 0 ), fPointers( 0 ), fId( 0 ),
            fBaseOffset( 0 ), fPosition( 0 ) {}

         TBranchElement*     fBranch;
         std::vector<void*>* fPointers;
         UChar_t             fId;
         UInt_t              fBaseOffset;
         Int_t               fPosition;
      };

      typedef std::map<TClass*, ElementBranchHelper_t> BranchMap_t;
      BranchMap_t fBranchMap;                         //! Branch map
      std::vector<ElementBranchHelper_t> fBranchVector; //! Branch vector
#endif // __CINT__

      TVirtualCollectionProxy* fCollProxy;    //! Collection proxy
      TBranch*                 fParent;       //! Parent of this branch
      TClass*                  fIndArrayCl;   //! Class of the ind array
      TIndArray                fInd;          //! Indices
      TString                  fContName;     //  Class name of referenced object
      TString                  fClassName;    //  Name of the parent class, if we're the data member
      mutable Int_t            fClassVersion; //  Version number of the class
      UInt_t                   fClCheckSum;   //  Class checksum
      mutable TStreamerInfo   *fInfo;         //! The streamer info
      char*                    fObject;       //! Pointer to object at address or the
      Int_t                    fID;           //  Element serial number in the streamer info
};

#endif // ROOT_TBranchSTL
 TBranchSTL.h:1
 TBranchSTL.h:2
 TBranchSTL.h:3
 TBranchSTL.h:4
 TBranchSTL.h:5
 TBranchSTL.h:6
 TBranchSTL.h:7
 TBranchSTL.h:8
 TBranchSTL.h:9
 TBranchSTL.h:10
 TBranchSTL.h:11
 TBranchSTL.h:12
 TBranchSTL.h:13
 TBranchSTL.h:14
 TBranchSTL.h:15
 TBranchSTL.h:16
 TBranchSTL.h:17
 TBranchSTL.h:18
 TBranchSTL.h:19
 TBranchSTL.h:20
 TBranchSTL.h:21
 TBranchSTL.h:22
 TBranchSTL.h:23
 TBranchSTL.h:24
 TBranchSTL.h:25
 TBranchSTL.h:26
 TBranchSTL.h:27
 TBranchSTL.h:28
 TBranchSTL.h:29
 TBranchSTL.h:30
 TBranchSTL.h:31
 TBranchSTL.h:32
 TBranchSTL.h:33
 TBranchSTL.h:34
 TBranchSTL.h:35
 TBranchSTL.h:36
 TBranchSTL.h:37
 TBranchSTL.h:38
 TBranchSTL.h:39
 TBranchSTL.h:40
 TBranchSTL.h:41
 TBranchSTL.h:42
 TBranchSTL.h:43
 TBranchSTL.h:44
 TBranchSTL.h:45
 TBranchSTL.h:46
 TBranchSTL.h:47
 TBranchSTL.h:48
 TBranchSTL.h:49
 TBranchSTL.h:50
 TBranchSTL.h:51
 TBranchSTL.h:52
 TBranchSTL.h:53
 TBranchSTL.h:54
 TBranchSTL.h:55
 TBranchSTL.h:56
 TBranchSTL.h:57
 TBranchSTL.h:58
 TBranchSTL.h:59
 TBranchSTL.h:60
 TBranchSTL.h:61
 TBranchSTL.h:62
 TBranchSTL.h:63
 TBranchSTL.h:64
 TBranchSTL.h:65
 TBranchSTL.h:66
 TBranchSTL.h:67
 TBranchSTL.h:68
 TBranchSTL.h:69
 TBranchSTL.h:70
 TBranchSTL.h:71
 TBranchSTL.h:72
 TBranchSTL.h:73
 TBranchSTL.h:74
 TBranchSTL.h:75
 TBranchSTL.h:76
 TBranchSTL.h:77
 TBranchSTL.h:78
 TBranchSTL.h:79
 TBranchSTL.h:80