00001
00002
00003
00004
00005
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 )
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;
00065 std::vector<ElementBranchHelper_t> fBranchVector;
00066 #endif // __CINT__
00067
00068 TVirtualCollectionProxy* fCollProxy;
00069 TBranch* fParent;
00070 TClass* fIndArrayCl;
00071 TIndArray fInd;
00072 TString fContName;
00073 TString fClassName;
00074 mutable Int_t fClassVersion;
00075 UInt_t fClCheckSum;
00076 mutable TStreamerInfo *fInfo;
00077 char* fObject;
00078 Int_t fID;
00079 };
00080
00081 #endif // ROOT_TBranchSTL