Go to the documentation of this file.00001 #ifndef Fireworks_Core_FWItemValueGetter_h
00002 #define Fireworks_Core_FWItemValueGetter_h
00003
00004
00005
00006
00007
00016
00017
00018
00019
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