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