CMS 3D CMS Logo

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

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

Private Member Functions

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

Private Attributes

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

Detailed Description

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

Usage: <usage>

Definition at line 34 of file FWExpressionValidator.h.

Constructor & Destructor Documentation

FWExpressionValidator::FWExpressionValidator ( )

Definition at line 172 of file FWExpressionValidator.cc.

References funct::abs(), funct::cos(), JetChargeProducer_cfi::exp, FUN1, FUN2, cmsBatch::log, SiStripPI::max, min(), funct::pow(), funct::sin(), mathSSE::sqrt(), and funct::tan().

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

Definition at line 205 of file FWExpressionValidator.cc.

206 {
207 }
FWExpressionValidator::FWExpressionValidator ( const FWExpressionValidator )
privatedelete

Member Function Documentation

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

Implements FWValidatorBase.

Definition at line 274 of file FWExpressionValidator.cc.

References begin, AlCaHLTBitMon_QueryRunRegistry::comp, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, class-composition::nodes, fireworks::OptionNode::OptionNode(), AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

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

Definition at line 225 of file FWExpressionValidator.cc.

References fireworks::OptionNode::fillOptionForType(), fireworks::OptionNode::m_type, groupFilesInBlocks::reverse, and tier0::unique().

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

226 {
227  using fireworks::OptionNode;
228  m_type=iType;
229  m_options.clear();
231  OptionNode::fillOptionForType(iType, m_options);
232  std::sort(m_options.begin(),m_options.end(),
234  std::vector<std::shared_ptr<OptionNode> >::iterator it=
235  std::unique(m_options.begin(),m_options.end(),
237  m_options.erase(it, m_options.end());
238 }
std::vector< std::shared_ptr< fireworks::OptionNode > > m_options
def unique(seq, keepstr=True)
Definition: tier0.py:25
std::vector< std::shared_ptr< fireworks::OptionNode > > m_builtins

Member Data Documentation

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

Definition at line 57 of file FWExpressionValidator.h.

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

Definition at line 56 of file FWExpressionValidator.h.

edm::TypeWithDict FWExpressionValidator::m_type
private

Definition at line 55 of file FWExpressionValidator.h.