/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/ParameterSet/interface/AllowedLabelsDescriptionBase.h
88 строк
3 KB
Chris Jones
Added `trackiness` function to parameter description code
07 фев 2026, 00:26
07 фев 2026, 00:26
0583fb2
Код
Авторство
О чём код?
#ifndef FWCore_ParameterSet_AllowedLabelsDescriptionBase_h #define FWCore_ParameterSet_AllowedLabelsDescriptionBase_h /** * \class AllowedLabelsDescriptionBase * * Description: Base class for AllowedLabelsDescription * Usage: This is the base class for all types which handle the case where one parameter of a PSet declares what labels are allowed to be used for the rest of the parameters in that PSet. The derived class is templated on the type of the other parameters. E.g. cms.PSet(labels = cms.untracked.vstring('a','b','c'), a = cms.untracked.int32(1), b = cms.untracked.int32(2) ) Here the parameter 'labels' declares that only parameters with labels 'a','b', or 'c' are allowed in this PSet. The parameters 'a' and 'b' are allowed, but if 'd' were used instead, validation would fail. */ #include "FWCore/ParameterSet/interface/ParameterDescriptionNode.h" #include "FWCore/ParameterSet/interface/ParameterDescription.h" #include <vector> #include <string> #include <set> #include <iosfwd> namespace edm { class ParameterSet; class AllowedLabelsDescriptionBase : public ParameterDescriptionNode { public: ~AllowedLabelsDescriptionBase() override; ParameterTypes type() const { return type_; } bool isTracked() const { return isTracked_; } protected: AllowedLabelsDescriptionBase(std::string const& label, ParameterTypes iType, bool isTracked); AllowedLabelsDescriptionBase(char const* label, ParameterTypes iType, bool isTracked); void printNestedContentBase_(std::ostream& os, bool optional, DocFormatHelper& dfh) const; private: void checkAndGetLabelsAndTypes_(std::set<std::string>& usedLabels, std::set<ParameterTypes>& parameterTypes, std::set<ParameterTypes>& wildcardTypes) const override; void validate_(ParameterSet& pset, std::set<std::string>& validatedLabels, Modifier modifier) const override; void writeCfi_(std::ostream& os, Modifier modifier, bool& startWithComma, int indentation, CfiOptions&, bool& wroteSomething) const override; void print_(std::ostream& os, Modifier modifier, bool writeToCfi, DocFormatHelper& dfh) const override; cfi::Trackiness trackiness_(std::string_view path) const override; bool hasNestedContent_() const override; void printNestedContent_(std::ostream& os, bool optional, DocFormatHelper& dfh) const override; bool exists_(ParameterSet const& pset) const override; bool partiallyExists_(ParameterSet const& pset) const override; int howManyXORSubNodesExist_(ParameterSet const& pset) const override; virtual void validateAllowedLabel_(std::string const& allowedLabel, ParameterSet& pset, std::set<std::string>& validatedLabels) const = 0; ParameterDescription<std::vector<std::string> > parameterHoldingLabels_; ParameterTypes type_; bool isTracked_; }; } // namespace edm #endif