CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FWExpressionValidator Class Reference

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

Inheritance diagram for FWExpressionValidator:
FWValidatorBase

List of all members.

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 ROOT::Reflex::Type &)
virtual ~FWExpressionValidator ()

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
ROOT::Reflex::Type 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 170 of file FWExpressionValidator.cc.

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

{
   using  fireworks::OptionNode;
   static const ROOT::Reflex::Type s_float(ROOT::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]

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 272 of file FWExpressionValidator.cc.

References begin, m_options, and cond::rpcobtemp::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,
                      ROOT::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 ROOT::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());
}

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().

ROOT::Reflex::Type FWExpressionValidator::m_type [private]

Definition at line 56 of file FWExpressionValidator.h.

Referenced by setType().