Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:03:19

0001 #ifndef FWCore_ParameterSet_IfExistsDescription_h
0002 #define FWCore_ParameterSet_IfExistsDescription_h
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterDescriptionNode.h"
0005 
0006 #include "FWCore/Utilities/interface/value_ptr.h"
0007 
0008 #include <memory>
0009 #include <iosfwd>
0010 #include <set>
0011 #include <string>
0012 
0013 namespace edm {
0014 
0015   class ParameterSet;
0016   class DocFormatHelper;
0017 
0018   class IfExistsDescription : public ParameterDescriptionNode {
0019   public:
0020     IfExistsDescription(ParameterDescriptionNode const& node_left, ParameterDescriptionNode const& node_right);
0021 
0022     IfExistsDescription(std::unique_ptr<ParameterDescriptionNode> node_left,
0023                         ParameterDescriptionNode const& node_right);
0024 
0025     IfExistsDescription(ParameterDescriptionNode const& node_left,
0026                         std::unique_ptr<ParameterDescriptionNode> node_right);
0027 
0028     IfExistsDescription(std::unique_ptr<ParameterDescriptionNode> node_left,
0029                         std::unique_ptr<ParameterDescriptionNode> node_right);
0030 
0031     ParameterDescriptionNode* clone() const override { return new IfExistsDescription(*this); }
0032 
0033   private:
0034     void checkAndGetLabelsAndTypes_(std::set<std::string>& usedLabels,
0035                                     std::set<ParameterTypes>& parameterTypes,
0036                                     std::set<ParameterTypes>& wildcardTypes) const override;
0037 
0038     void validate_(ParameterSet& pset, std::set<std::string>& validatedLabels, bool optional) const override;
0039 
0040     void writeCfi_(
0041         std::ostream& os, bool optional, bool& startWithComma, int indentation, bool& wroteSomething) const override;
0042 
0043     void print_(std::ostream& os, bool optional, bool writeToCfi, DocFormatHelper& dfh) const override;
0044 
0045     bool hasNestedContent_() const override { return true; }
0046 
0047     void printNestedContent_(std::ostream& os, bool optional, DocFormatHelper& dfh) const override;
0048 
0049     bool exists_(ParameterSet const& pset) const override;
0050 
0051     bool partiallyExists_(ParameterSet const& pset) const override;
0052 
0053     int howManyXORSubNodesExist_(ParameterSet const& pset) const override;
0054 
0055     void throwIfDuplicateLabels(std::set<std::string> const& labelsLeft,
0056                                 std::set<std::string> const& labelsRight) const;
0057 
0058     void throwIfDuplicateTypes(std::set<ParameterTypes> const& types1, std::set<ParameterTypes> const& types2) const;
0059 
0060     edm::value_ptr<ParameterDescriptionNode> node_left_;
0061     edm::value_ptr<ParameterDescriptionNode> node_right_;
0062   };
0063 }  // namespace edm
0064 #endif