AllowedLabelsDescriptionBase

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
#ifndef FWCore_ParameterSet_AllowedLabelsDescriptionBase_h
#define FWCore_ParameterSet_AllowedLabelsDescriptionBase_h

#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;

    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