test
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 FWParameterizable::begin(), FWGenericParameter< T >::changed_, def, FWParameterizable::end(), i, FWConfiguration::keyValues(), m_item, m_txtConfig, universalConfigTemplate::mode, mergeVDriftHistosByStation::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

Referenced by FWCaloRecHitDigitSetProxyBuilder::setItem(), FWGenParticleLegoProxyBuilder::setItem(), FWMuonRhoPhiProxyBuilder::setItem(), FWTrackingParticleProxyBuilder::setItem(), FWMuonProxyBuilder::setItem(), FWCandidateProxyBuilder::setItem(), FWTrackProxyBuilder::setItem(), FWTrackProxyBuilderFullFramework::setItem(), FWVertexProxyBuilder::setItem(), FWVertexCandidateProxyBuilder::setItem(), FWElectronProxyBuilder::setItem(), and FWJetProxyBuilder::setItem().

99 {
100  for ( const_iterator i = begin(); i != end(); ++i) {
101  if ((*i)->name() == name) {
102  return 0;
103  }
104  }
105 
107 
108  // std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
109  if ( m_txtConfig) {
110  const FWConfiguration* varConfig = m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : 0;
111  if (varConfig) mode->setFrom(*varConfig);
112  }
113  mode->changed_.connect(boost::bind(&FWEventItem::proxyConfigChanged, (FWEventItem*)m_item));
114  return mode;
115 }
int i
Definition: DBlmapReader.cc:9
std::vector< FWParameterBase * >::const_iterator const_iterator
const KeyValues * keyValues() const
const_iterator begin() const
void proxyConfigChanged()
Definition: FWEventItem.cc:370
sigc::signal< void, T > changed_
const_iterator end() const
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 119 of file FWProxyBuilderConfiguration.cc.

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

120 {
121  for ( const_iterator i = begin(); i != end(); ++i) {
122  if ((*i)->name() == name) {
123  return 0;
124  }
125  }
126 
128 
129  // std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
130  const FWConfiguration* varConfig = m_txtConfig && m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : 0;
131  if (varConfig) mode->setFrom(*varConfig);
132 
133  mode->changed_.connect(boost::bind(&FWEventItem::proxyConfigChanged, (FWEventItem*)m_item));
134  return mode;
135 }
int i
Definition: DBlmapReader.cc:9
std::vector< FWParameterBase * >::const_iterator const_iterator
const KeyValues * keyValues() const
const_iterator begin() const
void proxyConfigChanged()
Definition: FWEventItem.cc:370
sigc::signal< void, T > changed_
const_iterator end() const
T min(T a, T b)
Definition: MathUtil.h:58
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 137 of file FWProxyBuilderConfiguration.cc.

References FWParameterizable::begin(), FWParameterizable::end(), i, unpackData-CaloStage2::pname, 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__(), average.Average::average(), FWCaloRecHitDigitSetProxyBuilder::build(), FWMuonRhoPhiProxyBuilder::build(), FWGenParticleLegoProxyBuilder::build(), FWMuonProxyBuilder::build(), FWTrackProxyBuilder::build(), FWTrackProxyBuilderFullFramework::build(), FWVertexProxyBuilder::build(), FWVertexCandidateProxyBuilder::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(), FWElectronProxyBuilder::requestCommon(), and FWJetProxyBuilder::setTextPos().

138 {
139  FWGenericParameter<T>* param = 0;
140 
142  {
143  if ((*i)->name() == pname)
144  {
145  param = (FWGenericParameter<T>* )(*i);
146  break;
147  }
148  }
149 
150  if (param)
151  return param->value();
152  else
153  throw std::runtime_error("Invalid parameter request.");
154 }
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().