 |
OpenMS
3.0.0
|
|
Go to the documentation of this file.
38 #include <OpenMS/OpenMSConfig.h>
79 ParamEntry(
const std::string& n,
const ParamValue& v,
const std::string& d,
const std::vector<std::string>& t = std::vector<std::string>());
93 bool isValid(std::string& message)
const;
130 ParamNode(
const std::string& n,
const std::string& d);
163 ParamNode* findParentOf(
const std::string& name);
169 ParamEntry* findEntryRecursive(
const std::string& name);
178 std::string
suffix(
const std::string& key)
const;
200 inline TraceInfo(
const std::string& n,
const std::string& d,
bool o) :
234 std::string getName()
const;
236 const std::vector<TraceInfo>& getTrace()
const;
244 std::vector<const Param::ParamNode*>
stack_;
288 void setValue(
const std::string& key,
const ParamValue& value,
const std::string& description =
"",
const std::vector<std::string>& tags = std::vector<std::string>());
295 const ParamValue& getValue(
const std::string& key)
const;
309 const ParamEntry& getEntry(
const std::string& key)
const;
317 bool exists(
const std::string& key)
const;
325 bool hasSection(
const std::string& key)
const;
356 void addTag(
const std::string& key,
const std::string& tag);
364 void addTags(
const std::string& key,
const std::vector<std::string>& tags);
374 bool hasTag(
const std::string& key,
const std::string& tag)
const;
381 std::vector<std::string> getTags(
const std::string& key)
const;
388 void clearTags(
const std::string& key);
400 const std::string& getDescription(
const std::string& key)
const;
410 void setSectionDescription(
const std::string& key,
const std::string& description);
417 const std::string& getSectionDescription(
const std::string& key)
const;
424 void addSection(
const std::string& key,
const std::string& description);
441 void insert(
const std::string&
prefix,
const Param& param);
452 void remove(
const std::string& key);
462 void removeAll(
const std::string&
prefix);
471 Param copy(
const std::string&
prefix,
bool remove_prefix =
false)
const;
489 bool update(
const Param& p_outdated,
const bool add_unknown =
false);
519 bool update(
const Param& p_outdated,
bool verbose,
bool add_unknown,
bool fail_on_invalid_values,
bool fail_on_unknown_parameters,
Logger::LogStream& stream);
526 void merge(
const Param& toMerge);
542 void setDefaults(
const Param& defaults,
const std::string&
prefix =
"",
bool showMessage =
false);
563 void checkDefaults(
const std::string& name,
const Param& defaults,
const std::string&
prefix =
"")
const;
576 void setValidStrings(
const std::string& key,
const std::vector<std::string>& strings);
583 const std::vector<std::string>& getValidStrings(
const std::string& key)
const;
592 void setMinInt(
const std::string& key,
int min);
601 void setMaxInt(
const std::string& key,
int max);
610 void setMinFloat(
const std::string& key,
double min);
619 void setMaxFloat(
const std::string& key,
double max);
642 void parseCommandLine(
const int argc,
const char** argv,
const std::string&
prefix =
"");
657 void parseCommandLine(
const int argc,
const char** argv,
const std::map<std::string, std::string>& options_with_one_argument,
const std::map<std::string, std::string>& options_without_argument,
const std::map<std::string, std::string>& options_with_multiple_argument,
const std::string& misc =
"misc",
const std::string& unknown =
"unknown");
668 ParamEntry& getEntry_(
const std::string& key)
const;
678 OPENMS_DLLAPI std::ostream&
operator<<(std::ostream& os,
const Param& param);
std::vector< std::string > valid_strings
Default: empty.
Definition: Param.h:111
std::vector< ParamEntry > entries
Entries (leafs) in the node.
Definition: Param.h:185
ParamValue value
Value associated with the entry.
Definition: Param.h:102
std::vector< ParamEntry >::iterator EntryIterator
Iterator for entries.
Definition: Param.h:121
const Param::ParamNode * root_
Pointer to the root node.
Definition: Param.h:240
Parameter entry used to store the actual information inside of a Param entry.
Definition: Param.h:74
int min_int
Default: - std::numeric_limits<Int>::max()
Definition: Param.h:109
static String suffix(const String &this_s, size_t length)
Definition: StringUtilsSimple.h:156
DPosition< D, TCoordinateType > operator*(DPosition< D, TCoordinateType > position, typename DPosition< D, TCoordinateType >::CoordinateType scalar)
Scalar multiplication (a bit inefficient)
Definition: DPosition.h:426
Param::ParamNode root_
Invisible root node that stores all the data.
Definition: Param.h:674
std::string description
Description of the node.
Definition: Param.h:183
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
TraceInfo(const std::string &n, const std::string &d, bool o)
Constructor with name, description, and open flag.
Definition: Param.h:200
std::string description
Description of the entry.
Definition: Param.h:100
Class to hold strings, numeric values, vectors of strings and vectors of numeric values using the stl...
Definition: ParamValue.h:54
std::string name
Name of the node.
Definition: Param.h:181
ValueType
Supported types for ParamValue.
Definition: ParamValue.h:63
bool opened
If it was opened (true) or closed (false)
Definition: Param.h:212
Forward const iterator for the Param class.
Definition: Param.h:193
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::vector< ParamNode >::iterator NodeIterator
Iterator for child nodes.
Definition: Param.h:119
double max_float
Default: std::numeric_limits<double>::max()
Definition: Param.h:108
static String & remove(String &this_s, char what)
Definition: StringUtilsSimple.h:595
std::string description
description of the node
Definition: Param.h:210
double min_float
Default: - std::numeric_limits<double>::max()
Definition: Param.h:107
int max_int
Default: std::numeric_limits<Int>::max()
Definition: Param.h:110
int current_
Index of the current ParamEntry (-1 means invalid)
Definition: Param.h:242
std::vector< ParamNode >::const_iterator ConstNodeIterator
Iterator for child nodes.
Definition: Param.h:123
std::vector< TraceInfo > trace_
Node traversal data during last ++ operation.
Definition: Param.h:246
std::vector< ParamEntry >::const_iterator ConstEntryIterator
Iterator for entries.
Definition: Param.h:125
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
Log Stream Class.
Definition: LogStream.h:311
std::set< std::string > tags
Tags list, used e.g. for advanced parameter tag.
Definition: Param.h:104
int verbose
Verbosity level ( "-v" is 1 and "-V" is 2 )
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
Struct that captures information on entered / left nodes for ParamIterator.
Definition: Param.h:197
Management and storage of parameters / INI files.
Definition: Param.h:69
Node inside a Param object which is used to build the internal tree.
Definition: Param.h:116
static String prefix(const String &this_s, size_t length)
Definition: StringUtilsSimple.h:147
std::vector< const Param::ParamNode * > stack_
Pointers to the ParamNodes we are in.
Definition: Param.h:244
std::vector< ParamNode > nodes
Subnodes.
Definition: Param.h:187
std::string name
name of the node
Definition: Param.h:208
std::string name
Name of the entry.
Definition: Param.h:98