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 Member Functions | Private Attributes
FWProxyBuilderConfiguration Class Reference

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

Inheritance diagram for FWProxyBuilderConfiguration:
FWConfigurableParameterizable FWParameterSetterEditorBase FWParameterizable FWConfigurable

Public Member Functions

virtual void addTo (FWConfiguration &iTo) const
 
template<class T >
FWGenericParameter< T > * assertParam (const std::string &name, T def)
 
template<class T >
FWGenericParameterWithRange< T > * assertParam (const std::string &name, T def, T min, T max)
 
 FWProxyBuilderConfiguration (const FWConfiguration *c, const FWEventItem *item)
 
void populateFrame (TGCompositeFrame *frame)
 
virtual void setFrom (const FWConfiguration &iFrom)
 
template<class T >
T value (const std::string &name)
 
virtual ~FWProxyBuilderConfiguration ()
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
unsigned int version () const
 
virtual ~FWConfigurableParameterizable ()
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
virtual ~FWConfigurable ()
 
- Public Member Functions inherited from FWParameterSetterEditorBase
 FWParameterSetterEditorBase ()
 
virtual void updateEditor ()
 
virtual ~FWParameterSetterEditorBase ()
 

Private Member Functions

void makeSetter (TGCompositeFrame *, FWParameterBase *)
 

Private Attributes

const FWEventItemm_item
 
std::vector< boost::shared_ptr
< FWParameterSetterBase > > 
m_setters
 
const FWConfigurationm_txtConfig
 

Additional Inherited Members

- Public Types inherited from FWParameterizable
typedef std::vector
< FWParameterBase * >
::const_iterator 
const_iterator
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 42 of file FWProxyBuilderConfiguration.h.

Constructor & Destructor Documentation

FWProxyBuilderConfiguration::FWProxyBuilderConfiguration ( const FWConfiguration c,
const FWEventItem item 
)

Definition at line 33 of file FWProxyBuilderConfiguration.cc.

33  :
34  m_txtConfig(c),
35  m_item(item)
36 {
37 }
FWProxyBuilderConfiguration::~FWProxyBuilderConfiguration ( )
virtual

Definition at line 39 of file FWProxyBuilderConfiguration.cc.

References m_txtConfig.

40 {
41  delete m_txtConfig;
42 }

Member Function Documentation

void FWProxyBuilderConfiguration::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 48 of file FWProxyBuilderConfiguration.cc.

References FWConfiguration::addKeyValue(), FWConfigurableParameterizable::addTo(), FWParameterizable::begin(), and FWParameterizable::end().

49 {
50  if (begin() != end()) {
51  FWConfiguration vTmp;
53  iTo.addKeyValue("Var",vTmp, true);
54  }
55 }
const_iterator begin() const
const_iterator end() const
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
virtual void addTo(FWConfiguration &) const
template<class T >
FWGenericParameter< T > * FWProxyBuilderConfiguration::assertParam ( const std::string &  name,
T  def 
)

Definition at line 98 of file FWProxyBuilderConfiguration.cc.

References FWGenericParameter< T >::changed_, def, FWConfiguration::keyValues(), m_item, m_txtConfig, alignBH_cfg::mode, mergeVDriftHistosByStation::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

Referenced by FWGenParticleLegoProxyBuilder::setItem(), FWTrackingParticleProxyBuilder::setItem(), FWTrackProxyBuilderFullFramework::setItem(), FWVertexProxyBuilder::setItem(), and FWJetProxyBuilder::setItem().

99 {
101 
102  // std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
103  if ( m_txtConfig) {
104  const FWConfiguration* varConfig = m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : 0;
105  if (varConfig) mode->setFrom(*varConfig);
106  }
107  mode->changed_.connect(boost::bind(&FWEventItem::proxyConfigChanged, (FWEventItem*)m_item));
108  return mode;
109 }
const KeyValues * keyValues() const
void proxyConfigChanged()
Definition: FWEventItem.cc:368
sigc::signal< void, T > changed_
virtual void setFrom(const FWConfiguration &iFrom)
const FWConfiguration * valueForKey(const std::string &iKey) const
JetCorrectorParameters::Definitions def
Definition: classes.h:6
template<class T >
FWGenericParameterWithRange< T > * FWProxyBuilderConfiguration::assertParam ( const std::string &  name,
T  def,
T  min,
T  max 
)

Definition at line 113 of file FWProxyBuilderConfiguration.cc.

References FWGenericParameter< T >::changed_, def, FWConfiguration::keyValues(), m_item, m_txtConfig, max(), bookConverter::min, alignBH_cfg::mode, mergeVDriftHistosByStation::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

114 {
116 
117  // std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
118  const FWConfiguration* varConfig = m_txtConfig && m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : 0;
119  if (varConfig) mode->setFrom(*varConfig);
120 
121  mode->changed_.connect(boost::bind(&FWEventItem::proxyConfigChanged, (FWEventItem*)m_item));
122  return mode;
123 }
const KeyValues * keyValues() const
void proxyConfigChanged()
Definition: FWEventItem.cc:368
sigc::signal< void, T > changed_
const T & max(const T &a, const T &b)
virtual void setFrom(const FWConfiguration &iFrom)
const FWConfiguration * valueForKey(const std::string &iKey) const
JetCorrectorParameters::Definitions def
Definition: classes.h:6
void FWProxyBuilderConfiguration::makeSetter ( TGCompositeFrame *  frame,
FWParameterBase pb 
)
private

Definition at line 71 of file FWProxyBuilderConfiguration.cc.

References m_setters, and FWParameterSetterBase::makeSetterFor().

Referenced by populateFrame().

72 {
73  // std::cout << "make setter " << pb->name() << std::endl;
74 
75  boost::shared_ptr<FWParameterSetterBase> ptr( FWParameterSetterBase::makeSetterFor(pb) );
76  ptr->attach(pb, this);
77  TGFrame* tmpFrame = ptr->build(frame, false);
78  frame->AddFrame(tmpFrame, new TGLayoutHints(kLHintsExpandX));
79  m_setters.push_back(ptr);
80 }
static boost::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
std::vector< boost::shared_ptr< FWParameterSetterBase > > m_setters
void FWProxyBuilderConfiguration::populateFrame ( TGCompositeFrame *  frame)

Definition at line 83 of file FWProxyBuilderConfiguration.cc.

References FWParameterizable::begin(), FWParameterizable::end(), and makeSetter().

Referenced by CmsShowEDI::fillEDIFrame().

84 {
85  // std::cout << "populate \n";
86 
87  TGCompositeFrame* frame = new TGVerticalFrame(settersFrame);
88  settersFrame->AddFrame(frame, new TGLayoutHints(kLHintsExpandX) );//|kLHintsExpandY
89 
90  for(const_iterator it =begin(); it != end(); ++it)
91  makeSetter(frame, *it);
92 
93  settersFrame->MapSubwindows();
94 }
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
void makeSetter(TGCompositeFrame *, FWParameterBase *)
void FWProxyBuilderConfiguration::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 59 of file FWProxyBuilderConfiguration.cc.

60 {
61  /*
62  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it)
63  std::cout << it->first << "FWProxyBuilderConfiguration::setFrom " << std::endl;
64  }*/
65 }
template<class T >
template double FWProxyBuilderConfiguration::value< double > ( const std::string &  name)

Definition at line 125 of file FWProxyBuilderConfiguration.cc.

References FWParameterizable::begin(), FWParameterizable::end(), i, and FWGenericParameter< T >::value().

Referenced by Types.int32::__nonzero__(), Types.uint32::__nonzero__(), Types.int64::__nonzero__(), Types.uint64::__nonzero__(), Types.double::__nonzero__(), Types.bool::__nonzero__(), Types.string::__nonzero__(), FWGenParticleLegoProxyBuilder::build(), FWTrackProxyBuilderFullFramework::build(), FWVertexProxyBuilder::build(), FWJetProxyBuilder::buildViewType(), Vispa.Views.PropertyView.FileProperty::buttonClicked(), Types.string::configValue(), Types.FileInPath::configValue(), Mixins.UsingBlock::dumpPython(), Types.int32::insertInto(), Types.uint32::insertInto(), Types.int64::insertInto(), Types.uint64::insertInto(), Mixins.UsingBlock::insertInto(), Types.double::insertInto(), Types.bool::insertInto(), Types.string::insertInto(), Types.FileInPath::insertInto(), Types.vint32::insertInto(), Types.vuint32::insertInto(), Types.vint64::insertInto(), Types.vuint64::insertInto(), Types.vdouble::insertInto(), Types.vbool::insertInto(), Types.vstring::insertInto(), Vispa.Views.PropertyView.FileProperty::labelDoubleClicked(), and FWJetProxyBuilder::setTextPos().

126 {
127  FWGenericParameter<T>* param = 0;
128 
130  {
131  if ((*i)->name() == pname)
132  {
133  param = (FWGenericParameter<T>* )(*i);
134  break;
135  }
136  }
137 
138  if (param)
139  return param->value();
140  else
141  throw std::runtime_error("Invalid parameter request.");
142 }
int i
Definition: DBlmapReader.cc:9
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const

Member Data Documentation

const FWEventItem* FWProxyBuilderConfiguration::m_item
private

Definition at line 64 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam().

std::vector<boost::shared_ptr<FWParameterSetterBase> > FWProxyBuilderConfiguration::m_setters
private

Definition at line 67 of file FWProxyBuilderConfiguration.h.

Referenced by makeSetter().

const FWConfiguration* FWProxyBuilderConfiguration::m_txtConfig
private

Definition at line 63 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam(), and ~FWProxyBuilderConfiguration().