#include <Fireworks/Core/interface/FWParameterSetterBase.h>
Public Member Functions | |
void | attach (FWParameterBase *, FWParameterSetterEditorBase *) |
virtual TGFrame * | build (TGFrame *iParent, bool labelBack=true)=0 |
FWParameterSetterBase () | |
virtual void | setEnabled (bool) |
virtual | ~FWParameterSetterBase () |
Static Public Member Functions | |
static boost::shared_ptr < FWParameterSetterBase > | makeSetterFor (FWParameterBase *) |
Protected Member Functions | |
FWParameterSetterEditorBase * | frame () const |
void | update () const |
Private Member Functions | |
virtual void | attach (FWParameterBase *)=0 |
FWParameterSetterBase (const FWParameterSetterBase &) | |
const FWParameterSetterBase & | operator= (const FWParameterSetterBase &) |
Private Attributes | |
FWParameterSetterEditorBase * | m_frame |
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 32 of file FWParameterSetterBase.h.
FWParameterSetterBase::FWParameterSetterBase | ( | ) |
Definition at line 41 of file FWParameterSetterBase.cc.
: m_frame(0) { }
FWParameterSetterBase::~FWParameterSetterBase | ( | ) | [virtual] |
Definition at line 51 of file FWParameterSetterBase.cc.
{ }
FWParameterSetterBase::FWParameterSetterBase | ( | const FWParameterSetterBase & | ) | [private] |
void FWParameterSetterBase::attach | ( | FWParameterBase * | iBase, |
FWParameterSetterEditorBase * | iFrame | ||
) |
Definition at line 72 of file FWParameterSetterBase.cc.
References m_frame.
virtual void FWParameterSetterBase::attach | ( | FWParameterBase * | ) | [private, pure virtual] |
Implemented in FWEnumParameterSetter, FWBoolParameterSetter, FWDoubleParameterSetter, FWLongParameterSetter, and FWStringParameterSetter.
virtual TGFrame* FWParameterSetterBase::build | ( | TGFrame * | iParent, |
bool | labelBack = true |
||
) | [pure virtual] |
Implemented in FWEnumParameterSetter, FWBoolParameterSetter, FWDoubleParameterSetter, FWLongParameterSetter, and FWStringParameterSetter.
FWParameterSetterEditorBase* FWParameterSetterBase::frame | ( | ) | const [inline, protected] |
Definition at line 53 of file FWParameterSetterBase.h.
References m_frame.
Referenced by FWStringParameterSetter::build(), FWDoubleParameterSetter::build(), FWEnumParameterSetter::build(), FWBoolParameterSetter::build(), and FWLongParameterSetter::build().
{ return m_frame; }
boost::shared_ptr< FWParameterSetterBase > FWParameterSetterBase::makeSetterFor | ( | FWParameterBase * | iParam | ) | [static] |
Definition at line 95 of file FWParameterSetterBase.cc.
References edm::ObjectWithDict::address(), edm::TypeWithDict::byName(), edm::ObjectWithDict::castObject(), edm::ObjectWithDict::construct(), edm::TypeWithDict::destruct(), fwLog, fwlog::kError, edm::TypeWithDict::name(), mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by FWViewEnergyScaleEditor::addParam(), ViewerParameterGUI::addParam(), FWGeometryTableView::FWGeometryTableView(), CmsShowCommonPopup::makeSetter(), and FWProxyBuilderConfiguration::makeSetter().
{ static std::map<edm::TypeID,edm::TypeWithDict> s_paramToSetterMap; edm::TypeID paramType( typeid(*iParam) ); std::map<edm::TypeID,edm::TypeWithDict>::iterator itFind = s_paramToSetterMap.find(paramType); if (itFind == s_paramToSetterMap.end()) { edm::TypeWithDict paramClass(typeid(*iParam)); if (paramClass == edm::TypeWithDict()) { fwLog(fwlog::kError) << " the type "<<typeid(*iParam).name()<< " is not known to Root" <<std::endl; } assert(paramClass != edm::TypeWithDict() ); //the corresponding setter has the same name but with 'Setter' at the end std::string name = paramClass.name(); // FIXME: there was a convention between parameter class names and associated // setters. The following works around the problem introduced by // the generic parameter class but it is clear that a better // way of doing the binding is required. Notice that there are only 5 // different type of FW*Parameter. if (name == "FWGenericParameter<bool>") name = "FWBoolParameterSetter"; else if (name == "FWGenericParameter<std::string>") name = "FWStringParameterSetter"; else if (name == "FWGenericParameter<std::basic_string<char> >") name = "FWStringParameterSetter"; else if (name == "FWGenericParameterWithRange<double>") name = "FWDoubleParameterSetter"; else if (name == "FWGenericParameterWithRange<long int>") name = "FWLongParameterSetter"; else if (name == "FWGenericParameterWithRange<long>") name = "FWLongParameterSetter"; else name += "Setter"; edm::TypeWithDict setterClass( edm::TypeWithDict::byName( name ) ); if (setterClass == edm::TypeWithDict()) { fwLog(fwlog::kError) << " the type "<<name<< " has no dictionary" <<std::endl; } assert(setterClass != edm::TypeWithDict()); s_paramToSetterMap[paramType]=setterClass; itFind = s_paramToSetterMap.find(paramType); } //create the instance we want //NOTE: for some odd reason reflex 'Construct' uses 'malloc' to allocate the memory. This means the object // can not be deleted using 'delete'! So we must call Type::Destruct on the object edm::ObjectWithDict setterObj = itFind->second.construct(); //make it into the base class edm::TypeWithDict s_setterBaseType(typeid(FWParameterSetterBase)); assert(bool(s_setterBaseType)); edm::ObjectWithDict castSetterObj(setterObj.castObject(s_setterBaseType)); boost::shared_ptr<FWParameterSetterBase> ptr(reinterpret_cast<FWParameterSetterBase*>( castSetterObj.address() ), boost::bind(&edm::TypeWithDict::destruct,itFind->second,setterObj.address(),true)); return ptr; }
const FWParameterSetterBase& FWParameterSetterBase::operator= | ( | const FWParameterSetterBase & | ) | [private] |
void FWParameterSetterBase::setEnabled | ( | bool | ) | [virtual] |
Reimplemented in FWEnumParameterSetter, FWBoolParameterSetter, and FWDoubleParameterSetter.
Definition at line 157 of file FWParameterSetterBase.cc.
{ }
void FWParameterSetterBase::update | ( | void | ) | const [protected] |
Definition at line 84 of file FWParameterSetterBase.cc.
References m_frame, and FWParameterSetterEditorBase::updateEditor().
Referenced by FWLongParameterSetter::doUpdate(), FWDoubleParameterSetter::doUpdate(), FWBoolParameterSetter::doUpdate(), FWStringParameterSetter::doUpdate(), and FWEnumParameterSetter::doUpdate().
{ if (m_frame != 0) m_frame->updateEditor(); }
Definition at line 63 of file FWParameterSetterBase.h.