#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 fwLog, fwlog::kError, and mergeVDriftHistosByStation::name.
Referenced by FWViewEnergyScaleEditor::addParam(), ViewerParameterGUI::addParam(), FWGeometryTableView::FWGeometryTableView(), CmsShowCommonPopup::makeSetter(), and FWProxyBuilderConfiguration::makeSetter().
{ static std::map<edm::TypeID,ROOT::Reflex::Type> s_paramToSetterMap; edm::TypeID paramType( typeid(*iParam) ); std::map<edm::TypeID,ROOT::Reflex::Type>::iterator itFind = s_paramToSetterMap.find(paramType); if (itFind == s_paramToSetterMap.end()) { ROOT::Reflex::Type paramClass( ROOT::Reflex::Type::ByTypeInfo(typeid(*iParam)) ); if (paramClass == ROOT::Reflex::Type()) { fwLog(fwlog::kError) << " the type "<<typeid(*iParam).name()<< " is not known to REFLEX" <<std::endl; } assert(paramClass != ROOT::Reflex::Type() ); //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"; ROOT::Reflex::Type setterClass( ROOT::Reflex::Type::ByName( name ) ); if (setterClass == ROOT::Reflex::Type()) { fwLog(fwlog::kError) << " the type "<<name<< " is not known to REFLEX" <<std::endl; } assert(setterClass != ROOT::Reflex::Type()); 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 ROOT::Reflex::Object setterObj = itFind->second.Construct(); //make it into the base class ROOT::Reflex::Type s_setterBaseType( ROOT::Reflex::Type::ByTypeInfo( typeid(FWParameterSetterBase) ) ); assert(s_setterBaseType != ROOT::Reflex::Type()); ROOT::Reflex::Object castSetterObj = setterObj.CastObject(s_setterBaseType); boost::shared_ptr<FWParameterSetterBase> ptr(reinterpret_cast<FWParameterSetterBase*>( castSetterObj.Address() ), boost::bind(&ROOT::Reflex::Type::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.