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 "Reflex/Member.h"
00027 #include "Reflex/Type.h"
00028
00029 #include "CommonTools/Utils/src/SelectorPtr.h"
00030 #include "CommonTools/Utils/src/SelectorBase.h"
00031 #include "CommonTools/Utils/src/ExpressionPtr.h"
00032 #include "CommonTools/Utils/src/ExpressionBase.h"
00033
00034
00035 class FWItemValueGetter
00036 {
00037 public:
00038 FWItemValueGetter(const Reflex::Type&, const std::string& iPurpose);
00039 double valueFor(const void*, int idx) const;
00040 UInt_t precision( int idx) const;
00041 std::vector<std::string> getTitles() const;
00042 int numValues() const;
00043
00044 const std::string& getToolTip(const void* iObject) const;
00045
00046
00047 private:
00048 struct Entry {
00049 reco::parser::ExpressionPtr m_expr;
00050 std::string m_expression;
00051 std::string m_unit;
00052 std::string m_title;
00053 UInt_t m_precision;
00054
00055 Entry(reco::parser::ExpressionPtr iExpr, std::string iExpression, std::string iUnit, std::string iTitle, int iPrec) :
00056 m_expr(iExpr), m_expression(iExpression), m_unit(iUnit), m_title(iTitle), m_precision(iPrec) {}
00057 };
00058
00059 bool addEntry(std::string iExpression,int iPrec = 2, std::string iTitle = "", std::string iUnit = "");
00060
00061 typedef std::vector<Entry > Entries_t;
00062 Entries_t::const_iterator Entries_i;
00063
00064 Entries_t m_entries;
00065 Reflex::Type m_type;
00066
00067 int m_titleWidth;
00068
00069
00070 };
00071
00072 #endif