CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/FWCore/ParameterSet/interface/ParameterWildcardBase.h

Go to the documentation of this file.
00001 
00002 #ifndef FWCore_ParameterSet_ParameterWildcardBase_h
00003 #define FWCore_ParameterSet_ParameterWildcardBase_h
00004 
00005 #include "FWCore/ParameterSet/interface/ParameterDescriptionNode.h"
00006 
00007 #include <set>
00008 #include <string>
00009 #include <iosfwd>
00010 #include <vector>
00011 
00012 
00013 namespace edm {
00014 
00015   class ParameterSet;
00016   class DocFormatHelper;
00017 
00018   enum WildcardValidationCriteria {
00019     RequireZeroOrMore,
00020     RequireAtLeastOne,
00021     RequireExactlyOne
00022   };
00023 
00024   class ParameterWildcardBase : public ParameterDescriptionNode 
00025   {
00026   public:
00027     virtual ~ParameterWildcardBase();
00028 
00029     ParameterTypes type() const { return type_; }
00030     bool isTracked() const { return isTracked_; }
00031     WildcardValidationCriteria criteria() const { return criteria_; }
00032  
00033   protected:
00034     ParameterWildcardBase(ParameterTypes iType,
00035                           bool isTracked,
00036                           WildcardValidationCriteria criteria
00037                          );
00038 
00039     void throwIfInvalidPattern(char const* pattern) const;
00040     void throwIfInvalidPattern(std::string const& pattern) const;
00041 
00042     void validateMatchingNames(std::vector<std::string> const& matchingNames,
00043                                std::set<std::string> & validatedLabels,
00044                                bool optional) const;
00045 
00046   private:
00047 
00048     virtual void checkAndGetLabelsAndTypes_(std::set<std::string> & usedLabels,
00049                                             std::set<ParameterTypes> & parameterTypes,
00050                                             std::set<ParameterTypes> & wildcardTypes) const;
00051 
00052     virtual void writeCfi_(std::ostream & os,
00053                            bool & startWithComma,
00054                            int indentation,
00055                            bool & wroteSomething) const;
00056 
00057     virtual void print_(std::ostream & os,
00058                         bool optional,
00059                         bool writeToCfi,
00060                         DocFormatHelper & dfh);
00061 
00062     virtual bool partiallyExists_(ParameterSet const& pset) const;
00063 
00064     virtual int howManyXORSubNodesExist_(ParameterSet const& pset) const;
00065 
00066     ParameterTypes type_;
00067     bool isTracked_;
00068     WildcardValidationCriteria criteria_;
00069 
00070     // In the future we may want to add a string for the label if
00071     // default values are added to be inserted into a ParameterSet
00072     // when missing.
00073 
00074     // In the future we may want to add a string for the wildcard
00075     // pattern if we implement regular expressions, globbing, or some
00076     // other kind of wildcard patterns other than "*".
00077   };
00078 }
00079 #endif