35 #ifndef OPENMS_DATASTRUCTURES_PARAM_H 36 #define OPENMS_DATASTRUCTURES_PARAM_H 42 #include <OpenMS/OpenMSConfig.h> 50 template <
class Key,
class T>
87 ParamEntry(
const ParamEntry& other);
92 bool isValid(
String& message)
const;
140 EntryIterator findEntry(
const String& name);
146 NodeIterator findNode(
const String& name);
225 const std::vector<TraceInfo>& getTrace()
const;
233 std::vector<const Param::ParamNode*>
stack_;
293 bool exists(
const String& key)
const;
343 bool hasTag(
const String& key,
const String& tag)
const;
357 void clearTags(
const String& key);
379 void setSectionDescription(
const String& key,
const String& description);
386 const String& getSectionDescription(
const String& key)
const;
393 void addSection(
const String& key,
const String& description);
410 void insert(
const String& prefix,
const Param& param);
421 void remove(
const String& key);
431 void removeAll(
const String& prefix);
440 Param copy(
const String& prefix,
bool remove_prefix =
false)
const;
447 bool update(
const Param& p_outdated,
const bool add_unknown =
false);
477 bool update(
const Param& p_outdated,
bool verbose,
bool add_unknown,
bool fail_on_invalid_values,
bool fail_on_unknown_parameters,
Logger::LogStream& stream);
484 void merge(
const Param& toMerge);
500 void setDefaults(
const Param& defaults,
const String& prefix =
"",
bool showMessage =
false);
521 void checkDefaults(
const String& name,
const Param& defaults,
const String& prefix =
"")
const;
534 void setValidStrings(
const String& key,
const std::vector<String>& strings);
543 void setMinInt(
const String& key,
Int min);
552 void setMaxInt(
const String& key,
Int max);
561 void setMinFloat(
const String& key,
double min);
570 void setMaxFloat(
const String& key,
double max);
593 void parseCommandLine(
const int argc,
const char** argv,
const String& prefix =
"");
628 OPENMS_DLLAPI std::ostream&
operator<<(std::ostream& os,
const Param& param);
632 #endif // OPENMS_DATASTRUCTURES_PARAM_H
DataValue value
Value associated with the entry.
Definition: Param.h:101
A more convenient string class.
Definition: String.h:57
std::vector< ParamNode > nodes
Subnodes.
Definition: Param.h:176
std::vector< ParamEntry >::iterator EntryIterator
Iterator for entries.
Definition: Param.h:120
String description
Description of the node.
Definition: Param.h:172
const Param::ParamNode * root_
Pointer to the root node.
Definition: Param.h:229
Parameter entry used to store the actual information inside of a Param entry.
Definition: Param.h:80
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
std::vector< const Param::ParamNode * > stack_
Pointers to the ParamNodes we are in.
Definition: Param.h:233
Int current_
Index of the current ParamEntry (-1 means invalid)
Definition: Param.h:231
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
double max_float
Default: std::numeric_limits<double>::max()
Definition: Param.h:107
Log Stream Class.
Definition: LogStream.h:303
std::set< String > tags
Tags list, used e.g. for advanced parameter tag.
Definition: Param.h:103
Int min_int
Default: - std::numeric_limits<Int>::max()
Definition: Param.h:108
TraceInfo(const String &n, const String &d, bool o)
Constructor with name, description, and open flag.
Definition: Param.h:189
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:57
String name
Name of the node.
Definition: Param.h:170
String description
description of the node
Definition: Param.h:199
std::vector< ParamEntry >::const_iterator ConstEntryIterator
Iterator for entries.
Definition: Param.h:124
std::vector< ParamNode >::iterator NodeIterator
Iterator for child nodes.
Definition: Param.h:118
Int max_int
Default: std::numeric_limits<Int>::max()
Definition: Param.h:109
String name
Name of the entry.
Definition: Param.h:97
String name
name of the node
Definition: Param.h:197
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
DPosition< D, TCoordinateType > operator*(DPosition< D, TCoordinateType > position, typename DPosition< D, TCoordinateType >::CoordinateType scalar)
Scalar multiplication (a bit inefficient)
Definition: DPosition.h:421
Struct that captures information on entered / left nodes for ParamIterator.
Definition: Param.h:186
bool opened
If it was opened (true) or closed (false)
Definition: Param.h:201
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:74
String description
Description of the entry.
Definition: Param.h:99
Management and storage of parameters / INI files.
Definition: Param.h:75
std::vector< ParamNode >::const_iterator ConstNodeIterator
Iterator for child nodes.
Definition: Param.h:122
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
double min_float
Default: - std::numeric_limits<double>::max()
Definition: Param.h:106
std::vector< String > valid_strings
Default: empty.
Definition: Param.h:110
Forward const iterator for the Param class.
Definition: Param.h:182
std::vector< TraceInfo > trace_
Node traversal data during last ++ operation.
Definition: Param.h:235
Node inside a Param object which is used to build the internal tree.
Definition: Param.h:115
std::vector< ParamEntry > entries
Entries (leafs) in the node.
Definition: Param.h:174
int Int
Signed integer type.
Definition: Types.h:103
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:51
int verbose
Verbosity level ( "-v" is 1 and "-V" is 2 )
Param::ParamNode root_
Invisible root node that stores all the data.
Definition: Param.h:624