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
FWExpressionValidator Class Reference

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

Inheritance diagram for FWExpressionValidator:
FWValidatorBase

Public Member Functions

virtual void fillOptions (const char *iBegin, const char *iEnd, std::vector< std::pair< boost::shared_ptr< std::string >, std::string > > &oOptions) const
 
 FWExpressionValidator ()
 
void setType (const edm::TypeWithDict &)
 
virtual ~FWExpressionValidator ()
 
- Public Member Functions inherited from FWValidatorBase
 FWValidatorBase ()
 
virtual ~FWValidatorBase ()
 

Private Member Functions

 FWExpressionValidator (const FWExpressionValidator &)
 
const FWExpressionValidatoroperator= (const FWExpressionValidator &)
 

Private Attributes

std::vector< boost::shared_ptr
< fireworks::OptionNode > > 
m_builtins
 
std::vector< boost::shared_ptr
< fireworks::OptionNode > > 
m_options
 
edm::TypeWithDict m_type
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 35 of file FWExpressionValidator.h.

Constructor & Destructor Documentation

FWExpressionValidator::FWExpressionValidator ( )

Definition at line 173 of file FWExpressionValidator.cc.

References abs, funct::cos(), create_public_lumi_plots::exp, FUN1, FUN2, create_public_lumi_plots::log, m_builtins, max(), min, funct::pow(), funct::sin(), python.multivaluedict::sort(), mathSSE::sqrt(), and funct::tan().

174 {
175  using fireworks::OptionNode;
176  static const edm::TypeWithDict s_float(typeid(float));
177  FUN1(abs);
178  FUN1(acos);
179  FUN1(asin);
180  FUN1(atan);
181  FUN1(cos);
182  FUN1(cosh);
183  FUN1(exp);
184  FUN1(log);
185  FUN1(log10);
186  FUN1(sin);
187  FUN1(sinh);
188  FUN1(sqrt);
189  FUN1(tan);
190  FUN1(tanh);
191  FUN2(atan2);
192  FUN2(chi2prob);
193  FUN2(pow);
194  FUN2(min);
195  FUN2(max);
196  std::sort(m_builtins.begin(),m_builtins.end(),
198 
199 }
#define FUN1(_fun_)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define abs(x)
Definition: mlp_lapack.h:159
#define min(a, b)
Definition: mlp_lapack.h:161
#define FUN2(_fun_)
const T & max(const T &a, const T &b)
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< boost::shared_ptr< fireworks::OptionNode > > m_builtins
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
FWExpressionValidator::~FWExpressionValidator ( )
virtual

Definition at line 206 of file FWExpressionValidator.cc.

207 {
208 }
FWExpressionValidator::FWExpressionValidator ( const FWExpressionValidator )
private

Member Function Documentation

void FWExpressionValidator::fillOptions ( const char *  iBegin,
const char *  iEnd,
std::vector< std::pair< boost::shared_ptr< std::string >, std::string > > &  oOptions 
) const
virtual

Implements FWValidatorBase.

Definition at line 275 of file FWExpressionValidator.cc.

References begin, AlCaHLTBitMon_QueryRunRegistry::comp, m_options, AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

277 {
278  using fireworks::OptionNode;
279  oOptions.clear();
280  std::vector<const char*> delimeters;
281  findTypeDelimiters(iBegin, iEnd, delimeters);
282  //must find correct OptionNode
283  const Options* nodes = &m_options;
284  const char* begin = iBegin;
285  for(std::vector<const char*>::iterator it = delimeters.begin(), itEnd = delimeters.end();
286  it != itEnd; ++it) {
287  OptionNode temp(std::string(begin,*it),
288  *it-begin,
290 
291  boost::shared_ptr<OptionNode> comp(&temp, dummyDelete);
292  Options::const_iterator itFind =std::lower_bound(nodes->begin(),
293  nodes->end(),
294  comp,
296 
297  if(itFind == nodes->end() || *comp < *(*itFind) ) {
298  //no match so we have an error
299  return;
300  }
301  nodes = &((*itFind)->options());
302  begin = (*it)+1;
303  }
304 
305  //only use add items which begin with the part of the member we are trying to match
306  std::string part(begin,iEnd);
307  unsigned int part_size = part.size();
308  for(Options::const_iterator it = nodes->begin(), itEnd = nodes->end();
309  it != itEnd;
310  ++it) {
311  if(part == (*it)->description().substr(0,part_size) ) {
312  oOptions.push_back(std::make_pair(boost::shared_ptr<std::string>(const_cast<std::string*>(&((*it)->description())), dummyDelete),
313  (*it)->description().substr(part_size,(*it)->substitutionEnd()-part_size)));
314  }
315  }
316 }
std::vector< boost::shared_ptr< fireworks::OptionNode > > m_options
part
Definition: HCALResponse.h:20
#define begin
Definition: vmac.h:31
std::vector< boost::shared_ptr< fireworks::OptionNode > > Options
const FWExpressionValidator& FWExpressionValidator::operator= ( const FWExpressionValidator )
private
void FWExpressionValidator::setType ( const edm::TypeWithDict iType)

Definition at line 226 of file FWExpressionValidator.cc.

References m_builtins, m_options, m_type, and python.multivaluedict::sort().

Referenced by CmsShowEDI::fillEDIFrame(), and FWTableView::selectCollection().

227 {
228  using fireworks::OptionNode;
229  m_type=iType;
230  m_options.clear();
232  OptionNode::fillOptionForType(iType, m_options);
233  std::sort(m_options.begin(),m_options.end(),
235  std::vector<boost::shared_ptr<OptionNode> >::iterator it=
236  std::unique(m_options.begin(),m_options.end(),
238  m_options.erase(it, m_options.end());
239 }
std::vector< boost::shared_ptr< fireworks::OptionNode > > m_options
std::vector< boost::shared_ptr< fireworks::OptionNode > > m_builtins

Member Data Documentation

std::vector<boost::shared_ptr<fireworks::OptionNode> > FWExpressionValidator::m_builtins
private

Definition at line 58 of file FWExpressionValidator.h.

Referenced by FWExpressionValidator(), and setType().

std::vector<boost::shared_ptr<fireworks::OptionNode> > FWExpressionValidator::m_options
private

Definition at line 57 of file FWExpressionValidator.h.

Referenced by fillOptions(), and setType().

edm::TypeWithDict FWExpressionValidator::m_type
private

Definition at line 56 of file FWExpressionValidator.h.

Referenced by setType().