File indexing completed on 2024-05-23 03:13:13
0001
0002 #ifndef FWCore_ParameterSet_ParameterWildcardBase_h
0003 #define FWCore_ParameterSet_ParameterWildcardBase_h
0004
0005 #include "FWCore/ParameterSet/interface/ParameterDescriptionNode.h"
0006
0007 #include <set>
0008 #include <string>
0009 #include <iosfwd>
0010 #include <vector>
0011
0012 namespace edm {
0013
0014 class ParameterSet;
0015 class DocFormatHelper;
0016
0017 enum WildcardValidationCriteria { RequireZeroOrMore, RequireAtLeastOne, RequireExactlyOne };
0018
0019 class ParameterWildcardBase : public ParameterDescriptionNode {
0020 public:
0021 ~ParameterWildcardBase() override;
0022
0023 ParameterTypes type() const { return type_; }
0024 bool isTracked() const { return isTracked_; }
0025 WildcardValidationCriteria criteria() const { return criteria_; }
0026
0027 bool isWildcard() const override { return true; }
0028
0029 protected:
0030 ParameterWildcardBase(ParameterTypes iType, bool isTracked, WildcardValidationCriteria criteria);
0031
0032 void throwIfInvalidPattern(char const* pattern) const;
0033 void throwIfInvalidPattern(std::string const& pattern) const;
0034
0035 void validateMatchingNames(std::vector<std::string> const& matchingNames,
0036 std::set<std::string>& validatedLabels,
0037 bool optional) const;
0038
0039 private:
0040 void checkAndGetLabelsAndTypes_(std::set<std::string>& usedLabels,
0041 std::set<ParameterTypes>& parameterTypes,
0042 std::set<ParameterTypes>& wildcardTypes) const override;
0043
0044 void writeCfi_(std::ostream& os,
0045 bool optional,
0046 bool& startWithComma,
0047 int indentation,
0048 CfiOptions&,
0049 bool& wroteSomething) const override;
0050
0051 void print_(std::ostream& os, bool optional, bool writeToCfi, DocFormatHelper& dfh) const override;
0052
0053 bool partiallyExists_(ParameterSet const& pset) const override;
0054
0055 int howManyXORSubNodesExist_(ParameterSet const& pset) const override;
0056
0057 virtual void writeTemplate(std::ostream& os, int indentation, CfiOptions&) const;
0058 ParameterTypes type_;
0059 bool isTracked_;
0060 WildcardValidationCriteria criteria_;
0061
0062
0063
0064
0065
0066
0067
0068
0069 };
0070 }
0071 #endif