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);
305 void writeCfi(std::ostream& os,
bool startWithComma,
int indentation)
const;
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,
363 bool& wroteSomething);
369 std::set<ParameterTypes>
const& nodeWildcardTypes);
389 template <
typename T,
typename U>
391 U
const& iLabel,
T const&
value,
bool isTracked,
bool isOptional,
bool writeToCfi) {
392 std::unique_ptr<ParameterDescriptionNode> node =
393 std::make_unique<ParameterDescription<T>>(iLabel,
value, isTracked);
398 template <
typename T,
typename U>
403 std::unique_ptr<ParameterDescriptionNode> node = std::make_unique<ParameterDescription<T>>(iLabel, isTracked);
408 template <
typename U>
411 std::vector<ParameterSet>
const&
defaults,
415 std::unique_ptr<ParameterDescriptionNode> node =
416 std::make_unique<ParameterDescription<std::vector<ParameterSet>>>(iLabel, validator, isTracked,
defaults);
421 template <
typename U>
424 std::unique_ptr<ParameterDescriptionNode> node =
425 std::make_unique<ParameterDescription<std::vector<ParameterSet>>>(iLabel, validator, isTracked);
430 template <
typename T,
typename U>
432 std::unique_ptr<ParameterDescriptionNode> node =
438 template <
typename T>
443 std::unique_ptr<ParameterDescriptionNode> pdswitch =
444 std::make_unique<ParameterSwitch<T>>(switchParameter,
std::move(cases));
448 template <
typename T,
typename U>
453 std::unique_ptr<ParameterDescriptionNode> pd = std::make_unique<AllowedLabelsDescription<T>>(iLabel, isTracked);
457 template <
typename T,
typename U,
typename V>
459 U
const& iLabel,
bool isTracked,
bool optional,
bool writeToCfi,
V const&
desc) {
460 std::unique_ptr<ParameterDescriptionNode> pd =
461 std::make_unique<AllowedLabelsDescription<T>>(iLabel,
desc, isTracked);
SetDescriptionEntries entries_
ParameterDescriptionNode * labelsFrom(U const &iLabel, V const &desc)
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)
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)
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
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)
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)
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 * 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)
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
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_