CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWItemValueGetter.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWItemValueGetter_h
2 #define Fireworks_Core_FWItemValueGetter_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWItemValueGetter
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Sun Nov 30 16:14:58 EST 2008
19 // $Id: FWItemValueGetter.h,v 1.6 2012/06/26 22:13:03 wmtan Exp $
20 //
21 
22 #include <string>
23 #include <vector>
24 
25 #include "Rtypes.h"
26 #include "Reflex/Member.h"
27 #include "Reflex/Type.h"
28 
33 
34 
36 {
37 public:
38  FWItemValueGetter(const Reflex::Type&, const std::string& iPurpose);
39  double valueFor(const void*, int idx) const;
40  UInt_t precision( int idx) const;
41  std::vector<std::string> getTitles() const;
42  int numValues() const;
43 
44  const std::string& getToolTip(const void* iObject) const;
45 
46 
47 private:
48  struct Entry {
50  std::string m_expression;
51  std::string m_unit;
52  std::string m_title;
54 
55  Entry(reco::parser::ExpressionPtr iExpr, std::string iExpression, std::string iUnit, std::string iTitle, int iPrec) :
56  m_expr(iExpr), m_expression(iExpression), m_unit(iUnit), m_title(iTitle), m_precision(iPrec) {}
57  };
58 
59  bool addEntry(std::string iExpression,int iPrec = 2, std::string iTitle = "", std::string iUnit = "");
60 
61  typedef std::vector<Entry > Entries_t;
62  Entries_t::const_iterator Entries_i;
63 
66 
68 
69 
70 };
71 
72 #endif
Entry(reco::parser::ExpressionPtr iExpr, std::string iExpression, std::string iUnit, std::string iTitle, int iPrec)
Entries_t::const_iterator Entries_i
bool addEntry(std::string iExpression, int iPrec=2, std::string iTitle="", std::string iUnit="")
std::vector< Entry > Entries_t
boost::shared_ptr< ExpressionBase > ExpressionPtr
FWItemValueGetter(const Reflex::Type &, const std::string &iPurpose)
unsigned int UInt_t
Definition: FUTypes.h:12
std::vector< std::string > getTitles() const
double valueFor(const void *, int idx) const
const std::string & getToolTip(const void *iObject) const
reco::parser::ExpressionPtr m_expr
UInt_t precision(int idx) const