CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Fireworks/Core/interface/FWItemValueGetter.h

Go to the documentation of this file.
00001 #ifndef Fireworks_Core_FWItemValueGetter_h
00002 #define Fireworks_Core_FWItemValueGetter_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Core
00006 // Class  :     FWItemValueGetter
00007 //
00016 //
00017 // Original Author:  Chris Jones
00018 //         Created:  Sun Nov 30 16:14:58 EST 2008
00019 // $Id: FWItemValueGetter.h,v 1.8 2012/08/28 22:25:42 wmtan Exp $
00020 //
00021 
00022 #include <string>
00023 #include <vector>
00024 
00025 #include "Rtypes.h"
00026 #include "FWCore/Utilities/interface/TypeWithDict.h"
00027 
00028 #include "CommonTools/Utils/src/SelectorPtr.h"
00029 #include "CommonTools/Utils/src/SelectorBase.h"
00030 #include "CommonTools/Utils/src/ExpressionPtr.h"
00031 #include "CommonTools/Utils/src/ExpressionBase.h"
00032 
00033 
00034 class FWItemValueGetter
00035 {
00036 public:
00037    FWItemValueGetter(const edm::TypeWithDict&, const std::string& iPurpose);
00038    double valueFor(const void*, int idx) const;
00039    UInt_t precision( int idx) const;
00040    std::vector<std::string> getTitles() const;
00041    int numValues() const; 
00042 
00043    const std::string& getToolTip(const void* iObject) const;
00044 
00045 
00046 private:
00047    struct Entry {
00048       reco::parser::ExpressionPtr m_expr;
00049       std::string m_expression; 
00050       std::string m_unit;
00051       std::string m_title;
00052       UInt_t     m_precision;
00053 
00054       Entry(reco::parser::ExpressionPtr iExpr, std::string iExpression, std::string iUnit, std::string iTitle, int iPrec) :
00055          m_expr(iExpr), m_expression(iExpression), m_unit(iUnit), m_title(iTitle), m_precision(iPrec) {}
00056    };
00057 
00058    bool addEntry(std::string iExpression,int iPrec = 2,  std::string iTitle = "",  std::string iUnit = "");
00059 
00060    typedef std::vector<Entry > Entries_t;
00061    Entries_t::const_iterator Entries_i;
00062 
00063    Entries_t m_entries;
00064    edm::TypeWithDict m_type;
00065 
00066    int m_titleWidth;
00067 
00068    
00069 };
00070 
00071 #endif