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 edm::TypeWithDict &)
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
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 ( )
FWExpressionValidator::~FWExpressionValidator ( ) [virtual]

Definition at line 206 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 275 of file FWExpressionValidator.cc.

References begin, AlCaHLTBitMon_QueryRunRegistry::comp, m_options, AlCaHLTBitMon_QueryRunRegistry::string, 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,
                      edm::TypeWithDict());

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

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

Definition at line 56 of file FWExpressionValidator.h.

Referenced by setType().