15 #include "Reflex/Type.h"
16 #include "Reflex/Object.h"
20 #include <boost/bind.hpp>
94 boost::shared_ptr<FWParameterSetterBase>
97 static std::map<edm::TypeID,Reflex::Type> s_paramToSetterMap;
99 std::map<edm::TypeID,Reflex::Type>::iterator itFind = s_paramToSetterMap.find(paramType);
100 if (itFind == s_paramToSetterMap.end())
102 Reflex::Type paramClass( Reflex::Type::ByTypeInfo(
typeid(*iParam)) );
105 fwLog(
fwlog::kError) <<
" the type "<<
typeid(*iParam).name()<<
" is not known to REFLEX" <<std::endl;
110 std::string
name = paramClass.Name();
116 if (name ==
"FWGenericParameter<bool>")
117 name =
"FWBoolParameterSetter";
118 else if (name ==
"FWGenericParameter<std::string>")
119 name =
"FWStringParameterSetter";
120 else if (name ==
"FWGenericParameter<std::basic_string<char> >")
121 name =
"FWStringParameterSetter";
122 else if (name ==
"FWGenericParameterWithRange<double>")
123 name =
"FWDoubleParameterSetter";
124 else if (name ==
"FWGenericParameterWithRange<long int>")
125 name =
"FWLongParameterSetter";
126 else if (name ==
"FWGenericParameterWithRange<long>")
127 name =
"FWLongParameterSetter";
131 Reflex::Type setterClass( Reflex::Type::ByName( name ) );
138 s_paramToSetterMap[paramType]=setterClass;
139 itFind = s_paramToSetterMap.find(paramType);
144 Reflex::Object setterObj = itFind->second.Construct();
149 Reflex::Object castSetterObj = setterObj.CastObject(s_setterBaseType);
150 boost::shared_ptr<FWParameterSetterBase> ptr(reinterpret_cast<FWParameterSetterBase*>( castSetterObj.Address() ),
151 boost::bind(&Reflex::Type::Destruct,itFind->second,setterObj.Address(),
true));
virtual void updateEditor()
void attach(FWParameterBase *, FWParameterSetterEditorBase *)
static boost::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
virtual void setEnabled(bool)
FWParameterSetterEditorBase * m_frame
virtual ~FWParameterSetterBase()