1 #ifndef FWCore_ParameterSet_ParameterSetDescription_h 2 #define FWCore_ParameterSet_ParameterSetDescription_h 44 class ParameterWildcardBase;
45 class ParameterDescriptionNode;
49 class ParameterDescriptionCases;
50 class DocFormatHelper;
63 return node_.operator->();
94 template <
typename T,
typename U>
96 return add<T, U>(iLabel,
value,
true,
false,
true);
99 template <
typename T,
typename U>
101 return add<T, U>(iLabel,
value,
false,
false,
true);
104 template <
typename T,
typename U>
106 return add<T, U>(iLabel,
value,
true,
true,
true);
109 template <
typename T,
typename U>
111 return add<T, U>(iLabel,
value,
false,
true,
true);
117 template <
typename T,
typename U>
119 return add<T, U>(iLabel,
true,
false,
true);
122 template <
typename T,
typename U>
124 return add<T, U>(iLabel,
false,
false,
true);
127 template <
typename T,
typename U>
129 return add<T, U>(iLabel,
true,
true,
true);
132 template <
typename T,
typename U>
134 return add<T, U>(iLabel,
false,
true,
true);
148 template <
typename U>
151 std::vector<ParameterSet>
const&
defaults) {
152 return addVPSet<U>(iLabel, validator,
defaults,
true,
false,
true);
155 template <
typename U>
158 std::vector<ParameterSet>
const&
defaults) {
159 return addVPSet<U>(iLabel, validator,
defaults,
false,
false,
true);
162 template <
typename U>
165 std::vector<ParameterSet>
const&
defaults) {
166 return addVPSet<U>(iLabel, validator,
defaults,
true,
true,
true);
169 template <
typename U>
172 std::vector<ParameterSet>
const&
defaults) {
173 return addVPSet<U>(iLabel, validator,
defaults,
false,
true,
true);
176 template <
typename U>
178 return addVPSet<U>(iLabel, validator,
true,
false,
true);
181 template <
typename U>
183 return addVPSet<U>(iLabel, validator,
false,
false,
true);
186 template <
typename U>
188 return addVPSet<U>(iLabel, validator,
true,
true,
true);
191 template <
typename U>
193 return addVPSet<U>(iLabel, validator,
false,
true,
true);
198 template <
typename T,
typename U>
200 return addWildcard<T, U>(
pattern,
true);
203 template <
typename T,
typename U>
205 return addWildcard<T, U>(
pattern,
false);
219 template <
typename T>
222 return ifValue<T>(switchParameter,
std::move(cases),
false,
true);
225 template <
typename T>
229 return ifValue<T>(switchParameter,
std::move(cases),
true, writeToCfi);
234 return ifExists(node1, node2,
false,
true);
240 return ifExists(node1, node2,
true, writeToCfi);
244 template <
typename T,
typename U>
246 return labelsFrom<T, U>(iLabel,
true,
false,
true);
249 template <
typename T,
typename U>
251 return labelsFrom<T, U>(iLabel,
false,
false,
true);
254 template <
typename T,
typename U>
256 return labelsFrom<T, U>(iLabel,
true,
true, writeToCfi);
259 template <
typename T,
typename U>
261 return labelsFrom<T, U>(iLabel,
false,
true, writeToCfi);
272 template <
typename T,
typename U,
typename V>
274 return labelsFrom<T, U, V>(iLabel,
true,
false,
true,
desc);
277 template <
typename T,
typename U,
typename V>
279 return labelsFrom<T, U, V>(iLabel,
false,
false,
true,
desc);
282 template <
typename T,
typename U,
typename V>
284 return labelsFrom<T, U, V>(iLabel,
true,
true, writeToCfi,
desc);
287 template <
typename T,
typename U,
typename V>
289 return labelsFrom<T, U, V>(iLabel,
false,
true, writeToCfi,
desc);
312 template <
typename T,
typename U>
315 template <
typename T,
typename U>
318 template <
typename U>
321 std::vector<ParameterSet>
const&
defaults,
326 template <
typename U>
330 template <
typename T,
typename U>
335 template <
typename T>
346 template <
typename T,
typename U>
349 template <
typename T,
typename U,
typename V>
354 std::set<std::string>& validatedNames);
357 std::set<std::string>
const& validatedNames);
361 bool& startWithComma,
364 bool& wroteSomething);
370 std::set<ParameterTypes>
const& nodeWildcardTypes);
390 template <
typename T,
typename U>
392 U const& iLabel,
T const&
value,
bool isTracked,
bool isOptional,
bool writeToCfi) {
393 std::unique_ptr<ParameterDescriptionNode> node =
394 std::make_unique<ParameterDescription<T>>(iLabel,
value, isTracked);
399 template <
typename T,
typename U>
404 std::unique_ptr<ParameterDescriptionNode> node = std::make_unique<ParameterDescription<T>>(iLabel, isTracked);
409 template <
typename U>
412 std::vector<ParameterSet>
const&
defaults,
416 std::unique_ptr<ParameterDescriptionNode> node =
417 std::make_unique<ParameterDescription<std::vector<ParameterSet>>>(iLabel, validator, isTracked,
defaults);
422 template <
typename U>
425 std::unique_ptr<ParameterDescriptionNode> node =
426 std::make_unique<ParameterDescription<std::vector<ParameterSet>>>(iLabel, validator, isTracked);
431 template <
typename T,
typename U>
433 std::unique_ptr<ParameterDescriptionNode> node =
439 template <
typename T>
444 std::unique_ptr<ParameterDescriptionNode> pdswitch =
445 std::make_unique<ParameterSwitch<T>>(switchParameter,
std::move(cases));
449 template <
typename T,
typename U>
454 std::unique_ptr<ParameterDescriptionNode> pd = std::make_unique<AllowedLabelsDescription<T>>(iLabel, isTracked);
458 template <
typename T,
typename U,
typename V>
460 U const& iLabel,
bool isTracked,
bool optional,
bool writeToCfi,
V const&
desc) {
461 std::unique_ptr<ParameterDescriptionNode> pd =
462 std::make_unique<AllowedLabelsDescription<T>>(iLabel,
desc, isTracked);
SetDescriptionEntries entries_
ParameterDescriptionNode * labelsFrom(U const &iLabel, V const &desc)
bool isLabelUnused(std::string const &label) const
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
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)
void print(std::ostream &os, DocFormatHelper &dfh) const
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)
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 setWriteToCfi(bool value)
ParameterDescriptionBase * addVPSetOptional(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
std::set< std::string > usedLabels_
edm::value_ptr< ParameterDescriptionNode > const & node() const
ParameterDescriptionNode * labelsFromOptionalUntracked(U const &iLabel, bool writeToCfi, V const &desc)
ParameterDescriptionNode * labelsFromUntracked(U const &iLabel)
const_iterator end() const
SetDescriptionEntries::const_iterator const_iterator
ParameterDescriptionNode * ifExists(ParameterDescriptionNode const &node1, ParameterDescriptionNode const &node2)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
const_iterator begin() const
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
ParameterWildcardBase * addWildcardUntracked(U const &pattern)
std::set< ParameterTypes > typesUsedForParameters_
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel)
void setComment(std::string const &value)
ParameterDescriptionNode * labelsFromOptionalUntracked(U const &iLabel, bool writeToCfi)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
ParameterDescriptionBase * addVPSetOptionalUntracked(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
std::string const & comment() const
void throwIfLabelsAlreadyUsed(std::set< std::string > const &nodeLabels)
ParameterDescriptionNode * labelsFromOptional(U const &iLabel, bool writeToCfi)
ParameterDescriptionNode * addOptionalNode(ParameterDescriptionNode const &node, bool writeToCfi)
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 * setNode(std::unique_ptr< ParameterDescriptionNode > node)
ParameterDescriptionNode * ifValueOptional(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases, bool writeToCfi)
ParameterDescriptionBase * addVPSetOptionalUntracked(U const &iLabel, ParameterSetDescription const &validator)
ParameterSetDescription()
ParameterDescriptionBase * addVPSetUntracked(U const &iLabel, ParameterSetDescription const &validator)
void validate(ParameterSet &pset) const
ParameterDescriptionNode * labelsFromOptional(U const &iLabel, bool writeToCfi, V const &desc)
std::set< ParameterTypes > typesUsedForWildcards_
static void writeNode(SetDescriptionEntry const &entry, std::ostream &os, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething)
bool anythingAllowed() const
ParameterDescriptionNode * labelsFrom(U const &iLabel)
ParameterDescriptionBase * add(U const &iLabel)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * addUntracked(U const &iLabel)
ParameterDescriptionBase * addOptional(U const &iLabel)
void writeCfi(std::ostream &os, bool startWithComma, int indentation, CfiOptions &) const
ParameterDescriptionBase * addVPSetUntracked(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
virtual ~ParameterSetDescription()
cfi::CfiOptions CfiOptions
edm::value_ptr< ParameterDescriptionNode > node_