Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:28:50

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_(
0038         std::ostream& os, bool optional, bool& startWithComma, int indentation, bool& wroteSomething) const override;
0039 
0040     void print_(std::ostream& os, bool optional, bool writeToCfi, DocFormatHelper& dfh) const override;
0041 
0042     bool hasNestedContent_() const override;
0043 
0044     void printNestedContent_(std::ostream& os, bool optional, DocFormatHelper& dfh) const override;
0045 
0046     bool exists_(ParameterSet const& pset) const override;
0047 
0048     bool partiallyExists_(ParameterSet const& pset) const override;
0049 
0050     int howManyXORSubNodesExist_(ParameterSet const& pset) const override;
0051 
0052     virtual void validateAllowedLabel_(std::string const& allowedLabel,
0053                                        ParameterSet& pset,
0054                                        std::set<std::string>& validatedLabels) const = 0;
0055 
0056     ParameterDescription<std::vector<std::string> > parameterHoldingLabels_;
0057     ParameterTypes type_;
0058     bool isTracked_;
0059   };
0060 }  // namespace edm
0061 
0062 #endif