CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
FWItemValueGetter Class Reference

#include <Fireworks/Core/interface/FWItemValueGetter.h>

Public Member Functions

 FWItemValueGetter (const ROOT::Reflex::Type &, const std::vector< std::pair< std::string, std::string > > &iFindValueFrom)
 
bool isValid () const
 
void setValueAndUnit (const std::string &iValue, const std::string &iUnit)
 
const std::string & stringValueFor (const void *) const
 
const std::string & unit () const
 
double valueFor (const void *) const
 
std::string valueName () const
 

Private Attributes

ROOT::Reflex::Member m_memberFunction
 
ROOT::Reflex::Type m_type
 
std::string m_unit
 

Detailed Description

Description: Retrieves a particular value from an item

Usage: <usage>

Definition at line 31 of file FWItemValueGetter.h.

Constructor & Destructor Documentation

FWItemValueGetter::FWItemValueGetter ( const ROOT::Reflex::Type &  iType,
const std::vector< std::pair< std::string, std::string > > &  iFindValueFrom 
)

Definition at line 139 of file FWItemValueGetter.cc.

References m_memberFunction, m_unit, recursiveFindMember(), and cond::rpcobtemp::temp.

140  :
141  m_type(iType)
142 {
143  using namespace ROOT::Reflex;
144  for(std::vector<std::pair<std::string,std::string> >::const_iterator it = iFindValueFrom.begin(), itEnd=iFindValueFrom.end();
145  it != itEnd;
146  ++it) {
147  //std::cout <<" trying function "<<*it<<std::endl;
148  Member temp = recursiveFindMember(it->first,iType);
149  if(temp) {
150  if(0==temp.FunctionParameterSize(true)) {
151  //std::cout <<" FOUND "<<temp.Name()<<std::endl;
152  //std::cout <<" in type "<<temp.DeclaringType().Name(SCOPED)<<std::endl;
154  m_unit = it->second;
155  break;
156  }
157  }
158  }
159 }
static ROOT::Reflex::Member recursiveFindMember(const std::string &iName, const ROOT::Reflex::Type &iType)
ROOT::Reflex::Member m_memberFunction
ROOT::Reflex::Type m_type

Member Function Documentation

bool FWItemValueGetter::isValid ( void  ) const

Definition at line 209 of file FWItemValueGetter.cc.

References m_memberFunction.

Referenced by FWEventItem::haveInterestingValue().

210 {
211  return bool(m_memberFunction);
212 }
ROOT::Reflex::Member m_memberFunction
void FWItemValueGetter::setValueAndUnit ( const std::string &  iValue,
const std::string &  iUnit 
)
const std::string & FWItemValueGetter::stringValueFor ( const void *  iObject) const

Definition at line 199 of file FWItemValueGetter.cc.

References m_memberFunction, m_type, m_unit, VarParsing::obj, stringValueFor(), and cond::rpcobtemp::temp.

Referenced by FWEventItem::modelInterestingValueAsString().

200 {
201  ROOT::Reflex::Object temp(m_type,
202  const_cast<void*>(iObject));
203  ROOT::Reflex::Object obj= temp.CastObject(m_memberFunction.DeclaringType());
204 
206 }
tuple obj
Example code starts here #.
Definition: VarParsing.py:655
ROOT::Reflex::Member m_memberFunction
static const std::string & stringValueFor(const ROOT::Reflex::Object &iObj, const ROOT::Reflex::Member &iMember, const std::string &iUnit)
ROOT::Reflex::Type m_type
const std::string & FWItemValueGetter::unit ( ) const

Definition at line 221 of file FWItemValueGetter.cc.

References m_unit.

222 {
223  return m_unit;
224 }
double FWItemValueGetter::valueFor ( const void *  iObject) const

Definition at line 190 of file FWItemValueGetter.cc.

References doubleValueFor(), m_memberFunction, m_type, VarParsing::obj, and cond::rpcobtemp::temp.

Referenced by FWEventItem::modelInterestingValue(), and FWViewContextMenuHandlerGL::select().

191 {
192  ROOT::Reflex::Object temp(m_type,
193  const_cast<void*>(iObject));
194  ROOT::Reflex::Object obj= temp.CastObject(m_memberFunction.DeclaringType());
196 }
tuple obj
Example code starts here #.
Definition: VarParsing.py:655
ROOT::Reflex::Member m_memberFunction
static double doubleValueFor(const ROOT::Reflex::Object &iObj, const ROOT::Reflex::Member &iMember)
ROOT::Reflex::Type m_type
std::string FWItemValueGetter::valueName ( ) const

Definition at line 215 of file FWItemValueGetter.cc.

References m_memberFunction.

216 {
217  return m_memberFunction.Name();
218 }
ROOT::Reflex::Member m_memberFunction

Member Data Documentation

ROOT::Reflex::Member FWItemValueGetter::m_memberFunction
private

Definition at line 58 of file FWItemValueGetter.h.

Referenced by FWItemValueGetter(), isValid(), stringValueFor(), valueFor(), and valueName().

ROOT::Reflex::Type FWItemValueGetter::m_type
private

Definition at line 57 of file FWItemValueGetter.h.

Referenced by stringValueFor(), and valueFor().

std::string FWItemValueGetter::m_unit
private

Definition at line 59 of file FWItemValueGetter.h.

Referenced by FWItemValueGetter(), stringValueFor(), and unit().