CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

edm::ParameterWildcard< ParameterSetDescription > Class Template Reference

#include <ParameterWildcard.h>

Inheritance diagram for edm::ParameterWildcard< ParameterSetDescription >:
edm::ParameterWildcardBase edm::ParameterDescriptionNode

List of all members.

Public Member Functions

virtual ParameterDescriptionNodeclone () const
 ParameterWildcard (std::string const &pattern, WildcardValidationCriteria criteria, bool isTracked, ParameterSetDescription const &desc)
 ParameterWildcard (char const *pattern, WildcardValidationCriteria criteria, bool isTracked)
 ParameterWildcard (char const *pattern, WildcardValidationCriteria criteria, bool isTracked, ParameterSetDescription const &desc)
 ParameterWildcard (std::string const &pattern, WildcardValidationCriteria criteria, bool isTracked)
virtual ~ParameterWildcard ()

Private Member Functions

virtual bool exists_ (ParameterSet const &pset) const
virtual bool hasNestedContent_ ()
virtual void printNestedContent_ (std::ostream &os, bool optional, DocFormatHelper &helper)
virtual void validate_ (ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const
void validateDescription (std::string const &parameterName, ParameterSet &pset) const

Private Attributes

value_ptr
< ParameterSetDescription
psetDesc_

Detailed Description

template<>
class edm::ParameterWildcard< ParameterSetDescription >

Definition at line 67 of file ParameterWildcard.h.


Constructor & Destructor Documentation

edm::ParameterWildcard< ParameterSetDescription >::ParameterWildcard ( std::string const &  pattern,
WildcardValidationCriteria  criteria,
bool  isTracked 
)
edm::ParameterWildcard< ParameterSetDescription >::ParameterWildcard ( char const *  pattern,
WildcardValidationCriteria  criteria,
bool  isTracked 
)
edm::ParameterWildcard< ParameterSetDescription >::ParameterWildcard ( std::string const &  pattern,
WildcardValidationCriteria  criteria,
bool  isTracked,
ParameterSetDescription const &  desc 
)
edm::ParameterWildcard< ParameterSetDescription >::ParameterWildcard ( char const *  pattern,
WildcardValidationCriteria  criteria,
bool  isTracked,
ParameterSetDescription const &  desc 
)

Definition at line 50 of file ParameterWildcard.cc.

{ }

Member Function Documentation

Implements edm::ParameterDescriptionNode.

Definition at line 54 of file ParameterWildcard.cc.

References edm::ParameterWildcard< T >::ParameterWildcard().

                {
    return new ParameterWildcard(*this);
  }
bool edm::ParameterWildcard< ParameterSetDescription >::exists_ ( ParameterSet const &  pset) const [private, virtual]

Implements edm::ParameterDescriptionNode.

Definition at line 122 of file ParameterWildcard.cc.

References edm::ParameterWildcardBase::criteria(), edm::ParameterSet::getParameterNamesForType(), edm::ParameterWildcardBase::isTracked(), edm::RequireAtLeastOne, and edm::RequireZeroOrMore.

                                          {

    if (criteria() == RequireZeroOrMore) return true;

    std::vector<std::string> parameterNames  = pset.getParameterNamesForType<ParameterSet>(isTracked());

    if (criteria() == RequireAtLeastOne) return parameterNames.size() >= 1U;
    return parameterNames.size() == 1U;
  }
bool edm::ParameterWildcard< ParameterSetDescription >::hasNestedContent_ ( ) [private, virtual]

Reimplemented from edm::ParameterDescriptionNode.

Definition at line 86 of file ParameterWildcard.cc.

                      {
    if (psetDesc_) return true;
    return false;
  }
void edm::ParameterWildcard< ParameterSetDescription >::printNestedContent_ ( std::ostream &  os,
bool  optional,
DocFormatHelper helper 
) [private, virtual]

Reimplemented from edm::ParameterDescriptionNode.

Definition at line 93 of file ParameterWildcard.cc.

References edm::DocFormatHelper::brief(), edm::DocFormatHelper::counter(), edm::DocFormatHelper::indentation(), edm::DocFormatHelper::offsetSectionContent(), edm::DocFormatHelper::OTHER, edm::DocFormatHelper::parent(), edm::ParameterDescriptionNode::printSpaces(), edm::DocFormatHelper::section(), edm::DocFormatHelper::setIndentation(), edm::DocFormatHelper::setParent(), edm::DocFormatHelper::setSection(), and pat::TOP.

                                             {

    int indentation = dfh.indentation();
    if (dfh.parent() != DocFormatHelper::TOP) {
      indentation -= DocFormatHelper::offsetSectionContent();
    }

    printSpaces(os, indentation);
    os << "Section " << dfh.section() << "." << dfh.counter()
       << " description of PSet matching wildcard:";
    os << "\n";
    if (!dfh.brief()) os << "\n";

    std::stringstream ss;
    ss << dfh.section() << "." << dfh.counter();
    std::string newSection = ss.str();

    DocFormatHelper new_dfh(dfh);
    new_dfh.setSection(newSection);
    new_dfh.setIndentation(indentation + DocFormatHelper::offsetSectionContent());
    new_dfh.setParent(DocFormatHelper::OTHER);

    psetDesc_->print(os, new_dfh);
  }
void edm::ParameterWildcard< ParameterSetDescription >::validate_ ( ParameterSet pset,
std::set< std::string > &  validatedLabels,
bool  optional 
) const [private, virtual]

Implements edm::ParameterDescriptionNode.

Definition at line 60 of file ParameterWildcard.cc.

References edm::for_all(), edm::ParameterSet::getParameterNamesForType(), edm::ParameterWildcardBase::isTracked(), and edm::ParameterWildcardBase::validateMatchingNames().

                                 {

    std::vector<std::string> parameterNames  = pset.getParameterNamesForType<ParameterSet>(isTracked());
    validateMatchingNames(parameterNames, validatedLabels, optional);

    if (psetDesc_) {
      for_all(parameterNames,
              boost::bind(&ParameterWildcard<ParameterSetDescription>::validateDescription,
                          boost::cref(this),
                          _1,
                          boost::ref(pset)));
    }
  }
void edm::ParameterWildcard< ParameterSetDescription >::validateDescription ( std::string const &  parameterName,
ParameterSet pset 
) const [private]

Definition at line 78 of file ParameterWildcard.cc.

References edm::ParameterSet::getPSetForUpdate().

                                                 {
    ParameterSet * containedPSet = pset.getPSetForUpdate(parameterName);
    psetDesc_->validate(*containedPSet);
  }

Member Data Documentation

Definition at line 99 of file ParameterWildcard.h.