CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Fireworks/Core/src/FWItemValueGetter.cc File Reference

#include <sstream>
#include "Reflex/Object.h"
#include "Reflex/Base.h"
#include <cstdio>
#include "Fireworks/Core/interface/FWItemValueGetter.h"

Go to the source code of this file.

Functions

static double doubleValueFor (const ROOT::Reflex::Object &iObj, const ROOT::Reflex::Member &iMember)
static ROOT::Reflex::Member recursiveFindMember (const std::string &iName, const ROOT::Reflex::Type &iType)
static const std::string & stringValueFor (const ROOT::Reflex::Object &iObj, const ROOT::Reflex::Member &iMember, const std::string &iUnit)

Function Documentation

static double doubleValueFor ( const ROOT::Reflex::Object &  iObj,
const ROOT::Reflex::Member &  iMember 
) [static]

Definition at line 116 of file FWItemValueGetter.cc.

References reco::returnType().

Referenced by FWItemValueGetter::valueFor().

                                                                              {
   static TypeToDoubleMap s_map;
   if(s_map.empty() ) {
      addToDoubleMap<float>(s_map);
      addToDoubleMap<double>(s_map);
   }

   const Reflex::Type returnType = iMember.TypeOf().ReturnType().FinalType();

   //std::cout << val.TypeOf().TypeInfo().name()<<std::endl;
   TypeToDoubleMap::iterator itFound =s_map.find(returnType.TypeInfo().name());
   if(itFound == s_map.end()) {
      //std::cout <<" could not print because type is "<<iObj.TypeOf().TypeInfo().name()<<std::endl;
      return -999.0;
   }

   return itFound->second(iObj,iMember);
}
static ROOT::Reflex::Member recursiveFindMember ( const std::string &  iName,
const ROOT::Reflex::Type &  iType 
) [static]

Definition at line 32 of file FWItemValueGetter.cc.

References cond::rpcobtemp::temp.

Referenced by FWItemValueGetter::FWItemValueGetter().

{
   using namespace ROOT::Reflex;

   Member temp = iType.MemberByName(iName);
   if(temp) {return temp;}

   //try all base classes
   for(Base_Iterator it = iType.Base_Begin(), itEnd = iType.Base_End();
       it != itEnd;
       ++it) {
      temp = recursiveFindMember(iName,it->ToType());
      if(temp) {break;}
   }
   return temp;
}
static const std::string& stringValueFor ( const ROOT::Reflex::Object &  iObj,
const ROOT::Reflex::Member &  iMember,
const std::string &  iUnit 
) [static]

Definition at line 91 of file FWItemValueGetter.cc.

References reco::returnType().

{
   static std::string     s_empty_string;
   static TypeToStringMap s_map;
   if (s_map.empty())
   {
      addToStringMap<float>(s_map);
      addToStringMap<double>(s_map);
   }
   Reflex::Type returnType = iMember.TypeOf().ReturnType().FinalType();

   TypeToStringMap::iterator itFound =s_map.find(returnType.TypeInfo().name());
   if (itFound == s_map.end())
   {
      //std::cout <<" could not print because type is "<<iObj.TypeOf().TypeInfo().name()<<std::endl;
      return s_empty_string;
   }

   return itFound->second(iMember.Name(),iUnit,iObj,iMember);
}