TTreeFormulaManager.h

Go to the documentation of this file.
00001 // @(#)root/treeplayer:$Id: TTreeFormulaManager.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Philippe Canal   20/03/02
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and 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_TTreeFormulaManager
00013 #define ROOT_TTreeFormulaManager
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TTreeFormulaManager                                                  //
00019 //                                                                      //
00020 // A class coordinating several TTreeFormula objects.                   //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 
00025 #ifndef ROOT_TObjArray
00026 #include "TObjArray.h"
00027 #endif
00028 
00029 #include "TTreeFormula.h"
00030 
00031 class TArrayI;
00032 
00033 
00034 class TTreeFormulaManager : public TObject {
00035 private:
00036    TObjArray   fFormulas;
00037    Int_t       fMultiplicity;     // Indicator of the variability of the formula
00038    Bool_t      fMultiVarDim;      // True if one of the variable has 2 variable size dimensions.
00039    Int_t       fNdata;            //! Last value calculated by GetNdata
00040 
00041    //the next line should be: mutable Int_t fCumulUsedSizes[kMAXFORMDIM+1]; See GetNdata()
00042    Int_t       fCumulUsedSizes[kMAXFORMDIM+1];      //Accumulated size of lower dimensions as seen for this entry
00043    TArrayI    *fCumulUsedVarDims;                   //fCumulUsedSizes(1) for multi variable dimensions case
00044    //the next line should be: mutable Int_t fUsedSizes[kMAXFORMDIM+1]; See GetNdata()
00045    Int_t       fUsedSizes[kMAXFORMDIM+1];           //Actual size of the dimensions as seen for this entry.
00046    TArrayI    *fVarDims[kMAXFORMDIM+1];             //List of variable sizes dimensions.
00047    Int_t       fVirtUsedSizes[kMAXFORMDIM+1];       //Virtual size of lower dimensions as seen for this formula
00048 
00049    Bool_t      fNeedSync;         // Indicate whether a new formula has been added since the last synchronization
00050 
00051    friend class TTreeFormula;
00052 
00053 private:
00054    // Not implemented yet
00055    TTreeFormulaManager(const TTreeFormulaManager&);
00056    TTreeFormulaManager& operator=(const TTreeFormulaManager&);
00057 
00058 #if !defined(_MSC_VER) || (_MSC_VER < 1300) || defined(__CINT__)
00059    // Deletion is the sole responsability of the TTreeFormulas
00060    ~TTreeFormulaManager();
00061 #endif
00062 
00063 protected:
00064 
00065    virtual void       AddVarDims(Int_t virt_dim);
00066    virtual void       CancelDimension(Int_t virt_dim);
00067    virtual void       EnableMultiVarDims();
00068    virtual void       UpdateUsedSize(Int_t &virt_dim, Int_t vsize);
00069 
00070 public:
00071    TTreeFormulaManager();
00072 #if _MSC_VER >= 1300
00073    // cannot be private due to a bug in VC++7
00074    ~TTreeFormulaManager();
00075 #endif
00076    
00077    virtual void       Add(TTreeFormula*);
00078    virtual Int_t      GetMultiplicity() const {return fMultiplicity;}
00079    virtual Int_t      GetNdata(Bool_t forceLoadDim = kFALSE);
00080    virtual Bool_t     Notify() { UpdateFormulaLeaves(); return kTRUE; }
00081    virtual void       Remove(TTreeFormula*);
00082    virtual Bool_t     Sync();
00083    virtual void       UpdateFormulaLeaves();
00084 
00085    ClassDef(TTreeFormulaManager,0) // A class coordinating several TTreeFormula objects.
00086 };
00087 
00088 
00089 #endif // ROOT_TTreeFormulaManager
00090 

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