1 #ifndef FWCore_ParameterSet_ParameterSetDescription_h
2 #define FWCore_ParameterSet_ParameterSetDescription_h
44 class ParameterWildcardBase;
45 class ParameterDescriptionNode;
47 template <
typename T>
class ParameterDescriptionCases;
48 class DocFormatHelper;
88 template<
typename T,
typename U>
90 return add<T, U>(iLabel,
value,
true,
false,
true);
93 template<
typename T,
typename U>
95 return add<T, U>(iLabel,
value,
false,
false,
true);
98 template<
typename T,
typename U>
100 return add<T, U>(iLabel,
value,
true,
true,
true);
103 template<
typename T,
typename U>
105 return add<T, U>(iLabel,
value,
false,
true,
true);
111 template<
typename T,
typename U>
113 return add<T, U>(iLabel,
true,
false,
false);
116 template<
typename T,
typename U>
118 return add<T, U>(iLabel,
false,
false,
false);
121 template<
typename T,
typename U>
123 return add<T, U>(iLabel,
true,
true,
false);
126 template<
typename T,
typename U>
128 return add<T, U>(iLabel,
false,
true,
false);
145 std::vector<ParameterSet>
const&
defaults) {
146 return addVPSet<U>(iLabel, validator,
defaults,
true,
false,
true);
152 std::vector<ParameterSet>
const&
defaults) {
153 return addVPSet<U>(iLabel, validator,
defaults,
false,
false,
true);
159 std::vector<ParameterSet>
const&
defaults) {
160 return addVPSet<U>(iLabel, validator,
defaults,
true,
true,
true);
166 std::vector<ParameterSet>
const&
defaults) {
167 return addVPSet<U>(iLabel, validator,
defaults,
false,
true,
true);
173 return addVPSet<U>(iLabel, validator,
true,
false,
false);
179 return addVPSet<U>(iLabel, validator,
false,
false,
false);
185 return addVPSet<U>(iLabel, validator,
true,
true,
false);
191 return addVPSet<U>(iLabel, validator,
false,
true,
false);
196 template<
typename T,
typename U>
198 return addWildcard<T, U>(
pattern,
true);
201 template<
typename T,
typename U>
203 return addWildcard<T, U>(
pattern,
false);
217 template <
typename T>
221 return ifValue<T>(switchParameter, cases,
false,
true);
224 template <
typename T>
229 return ifValue<T>(switchParameter, cases,
true, writeToCfi);
236 return ifExists(node1, node2,
false,
true);
243 return ifExists(node1, node2,
true, writeToCfi);
247 template<
typename T,
typename U>
250 return labelsFrom<T,U>(iLabel,
true,
false,
true);
253 template<
typename T,
typename U>
256 return labelsFrom<T,U>(iLabel,
false,
false,
true);
259 template<
typename T,
typename U>
262 return labelsFrom<T,U>(iLabel,
true,
true, writeToCfi);
265 template<
typename T,
typename U>
268 return labelsFrom<T,U>(iLabel,
false,
true, writeToCfi);
279 template<
typename T,
typename U,
typename V>
282 return labelsFrom<T,U,V>(iLabel,
true,
false,
true, desc);
285 template<
typename T,
typename U,
typename V>
288 return labelsFrom<T,U,V>(iLabel,
false,
false,
true, desc);
291 template<
typename T,
typename U,
typename V>
294 return labelsFrom<T,U,V>(iLabel,
true,
true, writeToCfi, desc);
297 template<
typename T,
typename U,
typename V>
300 return labelsFrom<T,U,V>(iLabel,
false,
true, writeToCfi, desc);
322 void writeCfi(std::ostream & os,
bool startWithComma,
int indentation)
const;
330 template<
typename T,
typename U>
332 bool isTracked,
bool isOptional,
bool writeToCfi);
334 template<
typename T,
typename U>
336 bool isTracked,
bool isOptional,
bool writeToCfi);
341 std::vector<ParameterSet>
const&
defaults,
342 bool isTracked,
bool isOptional,
bool writeToCfi);
347 bool isTracked,
bool isOptional,
bool writeToCfi);
349 template<
typename T,
typename U>
354 template <
typename T>
358 bool optional,
bool writeToCfi);
363 bool optional,
bool writeToCfi);
365 template<
typename T,
typename U>
367 labelsFrom(U
const& iLabel,
bool isTracked,
bool optional,
bool writeToCfi);
369 template<
typename T,
typename U,
typename V>
371 labelsFrom(U
const& iLabel,
bool isTracked,
bool optional,
bool writeToCfi, V
const& desc);
377 std::set<std::string> & validatedNames);
381 std::set<std::string>
const& validatedNames);
386 bool & startWithComma,
388 bool & wroteSomething);
397 std::set<ParameterTypes>
const& nodeWildcardTypes);
417 template<
typename T,
typename U>
426 template<
typename T,
typename U>
439 std::vector<ParameterSet>
const&
defaults,
440 bool isTracked,
bool isOptional,
bool writeToCfi) {
441 std::auto_ptr<ParameterDescriptionNode> node(
451 bool isTracked,
bool isOptional,
bool writeToCfi) {
452 std::auto_ptr<ParameterDescriptionNode> node(
458 template<
typename T,
typename U>
467 template <
typename T>
471 bool optional,
bool writeToCfi) {
472 std::auto_ptr<ParameterDescriptionNode> pdswitch(
new ParameterSwitch<T>(switchParameter, cases));
473 return addNode(pdswitch, optional, writeToCfi);
476 template<
typename T,
typename U>
480 return addNode(pd, optional, writeToCfi);
483 template<
typename T,
typename U,
typename V>
487 return addNode(pd, optional, writeToCfi);
SetDescriptionEntries entries_
ParameterDescriptionNode * labelsFrom(U const &iLabel, V const &desc)
std::vector< SetDescriptionEntry > SetDescriptionEntries
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
static void throwIllegalParameters(std::vector< std::string > const ¶meterNames, std::set< std::string > const &validatedNames)
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
void reserve(SetDescriptionEntries::size_type n)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
edm::value_ptr< ParameterDescriptionNode > const & node() const
ParameterDescriptionNode * labelsFromUntracked(U const &iLabel, V const &desc)
void setOptional(bool value)
void throwIfWildcardCollision(std::set< ParameterTypes > const &nodeParameterTypes, std::set< ParameterTypes > const &nodeWildcardTypes)
ParameterWildcardBase * addWildcard(U const &pattern)
void setAllowAnything()
allow any parameter label/value pairs
void validate(ParameterSet &pset) const
void setWriteToCfi(bool value)
ParameterDescriptionBase * addVPSetOptional(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
std::set< std::string > usedLabels_
const_iterator end() const
ParameterDescriptionNode * labelsFromOptionalUntracked(U const &iLabel, bool writeToCfi, V const &desc)
ParameterDescriptionNode * labelsFromUntracked(U const &iLabel)
SetDescriptionEntries::const_iterator const_iterator
ParameterDescriptionNode * ifExists(ParameterDescriptionNode const &node1, ParameterDescriptionNode const &node2)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
static void writeNode(SetDescriptionEntry const &entry, std::ostream &os, bool &startWithComma, int indentation, bool &wroteSomething)
ParameterDescriptionNode * setNode(std::auto_ptr< ParameterDescriptionNode > node)
void writeCfi(std::ostream &os, bool startWithComma, int indentation) const
ParameterWildcardBase * addWildcardUntracked(U const &pattern)
std::set< ParameterTypes > typesUsedForParameters_
const_iterator begin() const
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel)
void setComment(std::string const &value)
bool anythingAllowed() const
ParameterDescriptionNode * labelsFromOptionalUntracked(U const &iLabel, bool writeToCfi)
ParameterDescriptionBase * addVPSetOptionalUntracked(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
void throwIfLabelsAlreadyUsed(std::set< std::string > const &nodeLabels)
ParameterDescriptionNode * labelsFromOptional(U const &iLabel, bool writeToCfi)
void print(std::ostream &os, DocFormatHelper &dfh) const
ParameterDescriptionNode * addOptionalNode(ParameterDescriptionNode const &node, bool writeToCfi)
bool isLabelUnused(std::string const &label) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ParameterDescriptionBase * addVPSetOptional(U const &iLabel, ParameterSetDescription const &validator)
static void validateNode(SetDescriptionEntry const &entry, ParameterSet &pset, std::set< std::string > &validatedNames)
static void printNode(SetDescriptionEntry const &entry, std::ostream &os, DocFormatHelper &dfh)
ParameterDescriptionNode * ifExistsOptional(ParameterDescriptionNode const &node1, ParameterDescriptionNode const &node2, bool writeToCfi)
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases)
ParameterDescriptionBase * addVPSetOptionalUntracked(U const &iLabel, ParameterSetDescription const &validator)
ParameterSetDescription()
ParameterDescriptionBase * addVPSetUntracked(U const &iLabel, ParameterSetDescription const &validator)
ParameterDescriptionNode * labelsFromOptional(U const &iLabel, bool writeToCfi, V const &desc)
std::set< ParameterTypes > typesUsedForWildcards_
ParameterDescriptionNode * labelsFrom(U const &iLabel)
ParameterDescriptionBase * add(U const &iLabel)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * addUntracked(U const &iLabel)
std::string const & comment() const
ParameterDescriptionNode * ifValueOptional(ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases, bool writeToCfi)
ParameterDescriptionBase * addOptional(U const &iLabel)
ParameterDescriptionBase * addVPSetUntracked(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
virtual ~ParameterSetDescription()
edm::value_ptr< ParameterDescriptionNode > node_