00001 // @(#)root/base:$Id: TBranchProxyDirector.h 34913 2010-08-20 19:18:35Z pcanal $ 00002 // Author: Philippe Canal 13/05/2003 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2004, Rene Brun, Fons Rademakers and al. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TBranchProxyDirector 00013 #define ROOT_TBranchProxyDirector 00014 00015 #ifndef ROOT_Rtypes 00016 #include "Rtypes.h" 00017 #endif 00018 00019 #include <list> 00020 00021 #ifdef R__OLDHPACC 00022 namespace std { 00023 using ::list; 00024 } 00025 #endif 00026 00027 class TH1F; 00028 class TTree; 00029 00030 namespace ROOT { 00031 class TBranchProxy; 00032 class TFriendProxy; 00033 00034 class TBranchProxyDirector { 00035 00036 //This class could actually be the selector itself. 00037 TTree *fTree; // TTree we are currently looking at. 00038 Long64_t fEntry; // Entry currently being read. 00039 00040 std::list<TBranchProxy*> fDirected; 00041 std::list<TFriendProxy*> fFriends; 00042 00043 TBranchProxyDirector(const TBranchProxyDirector &) : fTree(0), fEntry(-1) {;} 00044 TBranchProxyDirector& operator=(const TBranchProxyDirector&) {return *this;} 00045 00046 public: 00047 00048 TBranchProxyDirector(TTree* tree, Long64_t i); 00049 TBranchProxyDirector(TTree* tree, Int_t i); // cint has (had?) a problem casting int to long long 00050 00051 void Attach(TBranchProxy* p); 00052 void Attach(TFriendProxy* f); 00053 TH1F* CreateHistogram(const char *options); 00054 Long64_t GetReadEntry() const { return fEntry; } 00055 TTree* GetTree() const { return fTree; }; 00056 // void Print(); 00057 void SetReadEntry(Long64_t entry); 00058 TTree* SetTree(TTree *newtree); 00059 00060 }; 00061 00062 } /* namespace ROOT */ 00063 00064 #endif