#include <Fireworks/Core/interface/FWExpressionValidator.h>
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 Reflex::Type &) |
virtual | ~FWExpressionValidator () |
Private Member Functions | |
FWExpressionValidator (const FWExpressionValidator &) | |
const FWExpressionValidator & | operator= (const FWExpressionValidator &) |
Private Attributes | |
std::vector< boost::shared_ptr < fireworks::OptionNode > > | m_builtins |
std::vector< boost::shared_ptr < fireworks::OptionNode > > | m_options |
Reflex::Type | m_type |
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 35 of file FWExpressionValidator.h.
FWExpressionValidator::FWExpressionValidator | ( | ) |
Definition at line 170 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().
{ using fireworks::OptionNode; static const Reflex::Type s_float(Reflex::Type::ByTypeInfo(typeid(float))); FUN1(abs); FUN1(acos); FUN1(asin); FUN1(atan); FUN1(cos); FUN1(cosh); FUN1(exp); FUN1(log); FUN1(log10); FUN1(sin); FUN1(sinh); FUN1(sqrt); FUN1(tan); FUN1(tanh); FUN2(atan2); FUN2(chi2prob); FUN2(pow); FUN2(min); FUN2(max); std::sort(m_builtins.begin(),m_builtins.end(), fireworks::OptionNodePtrCompare<boost::shared_ptr<OptionNode> >()); }
FWExpressionValidator::~FWExpressionValidator | ( | ) | [virtual] |
Definition at line 203 of file FWExpressionValidator.cc.
{ }
FWExpressionValidator::FWExpressionValidator | ( | const FWExpressionValidator & | ) | [private] |
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 272 of file FWExpressionValidator.cc.
References begin, m_options, and groupFilesInBlocks::temp.
{ using fireworks::OptionNode; oOptions.clear(); std::vector<const char*> delimeters; findTypeDelimiters(iBegin, iEnd, delimeters); //must find correct OptionNode const Options* nodes = &m_options; const char* begin = iBegin; for(std::vector<const char*>::iterator it = delimeters.begin(), itEnd = delimeters.end(); it != itEnd; ++it) { OptionNode temp(std::string(begin,*it), *it-begin, Reflex::Type()); boost::shared_ptr<OptionNode> comp(&temp, dummyDelete); Options::const_iterator itFind =std::lower_bound(nodes->begin(), nodes->end(), comp, fireworks::OptionNodePtrCompare<boost::shared_ptr<OptionNode> >()); if(itFind == nodes->end() || *comp < *(*itFind) ) { //no match so we have an error return; } nodes = &((*itFind)->options()); begin = (*it)+1; } //only use add items which begin with the part of the member we are trying to match std::string part(begin,iEnd); unsigned int part_size = part.size(); for(Options::const_iterator it = nodes->begin(), itEnd = nodes->end(); it != itEnd; ++it) { if(part == (*it)->description().substr(0,part_size) ) { oOptions.push_back(std::make_pair(boost::shared_ptr<std::string>(const_cast<std::string*>(&((*it)->description())), dummyDelete), (*it)->description().substr(part_size,(*it)->substitutionEnd()-part_size))); } } }
const FWExpressionValidator& FWExpressionValidator::operator= | ( | const FWExpressionValidator & | ) | [private] |
void FWExpressionValidator::setType | ( | const Reflex::Type & | iType | ) |
Definition at line 223 of file FWExpressionValidator.cc.
References m_builtins, m_options, m_type, and python::multivaluedict::sort().
Referenced by CmsShowEDI::fillEDIFrame(), and FWTableView::selectCollection().
{ using fireworks::OptionNode; m_type=iType; m_options.clear(); m_options=m_builtins; OptionNode::fillOptionForType(iType, m_options); std::sort(m_options.begin(),m_options.end(), fireworks::OptionNodePtrCompare<boost::shared_ptr<OptionNode> >()); std::vector<boost::shared_ptr<OptionNode> >::iterator it= std::unique(m_options.begin(),m_options.end(), fireworks::OptionNodePtrEqual<boost::shared_ptr<OptionNode> >()); m_options.erase(it, m_options.end()); }
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().
Reflex::Type FWExpressionValidator::m_type [private] |
Definition at line 56 of file FWExpressionValidator.h.
Referenced by setType().