10#include <OpenMS/OpenMSConfig.h>
104 operator
std::
string() const;
111 operator
std::vector<
std::
string>() const;
118 operator
std::vector<
int>() const;
125 operator
std::vector<
double>() const;
134 operator
long double() const;
143 operator
double() const;
152 operator
float() const;
161 operator
short int() const;
170 operator
unsigned short int() const;
180 operator
int() const;
189 operator
unsigned int() const;
198 operator
long int() const;
207 operator
unsigned long int() const;
216 operator
long long() const;
225 operator
unsigned long long() const;
242 const
char* toChar() const;
250 std::
string toString(
bool full_precision = true) const;
257 std::vector<
std::
string> toStringVector() const;
264 std::vector<
int> toIntVector() const;
271 std::vector<
double> toDoubleVector() const;
328 return value_type_ == EMPTY_VALUE;
354 std::ptrdiff_t ssize_;
357 std::vector<std::string>* str_list_;
358 std::vector<int>* int_list_;
359 std::vector<double>* dou_list_;
370 static
std::
string doubleToString(
double value,
bool full_precision = true);
384 std::size_t seed = hash_int(
static_cast<unsigned char>(pv.valueType()));
386 switch (pv.valueType())
388 case ParamValue::EMPTY_VALUE:
391 case ParamValue::STRING_VALUE:
394 hash_combine(seed, fnv1a_hash_string(s));
397 case ParamValue::INT_VALUE:
399 std::ptrdiff_t i =
static_cast<long long>(pv);
400 hash_combine(seed, hash_int(i));
403 case ParamValue::DOUBLE_VALUE:
406 hash_combine(seed, hash_float(d));
409 case ParamValue::STRING_LIST:
411 std::vector<std::string> sl = pv.toStringVector();
412 hash_combine(seed, hash_int(sl.size()));
413 for (
const auto& s : sl)
415 hash_combine(seed, fnv1a_hash_string(s));
419 case ParamValue::INT_LIST:
421 std::vector<int> il = pv.toIntVector();
422 hash_combine(seed, hash_int(il.size()));
425 hash_combine(seed, hash_int(i));
429 case ParamValue::DOUBLE_LIST:
431 std::vector<double> dl = pv.toDoubleVector();
432 hash_combine(seed, hash_int(dl.size()));
435 hash_combine(seed, hash_float(d));
Class to hold strings, numeric values, vectors of strings and vectors of numeric values using the stl...
Definition ParamValue.h:31
friend std::ostream & operator<<(std::ostream &, const ParamValue &)
output stream operator
ValueType value_type_
Type of the currently stored value.
Definition ParamValue.h:349
ParamValue()
Default constructor.
friend bool operator==(const ParamValue &, const ParamValue &)
Equality comparator.
ParamValue(const ParamValue &)
Copy constructor.
void clear_() noexcept
Clears the current state of the ParamValue and release every used memory.
friend bool operator!=(const ParamValue &, const ParamValue &)
Equality comparator.
bool isEmpty() const
Test if the value is empty.
Definition ParamValue.h:326
friend bool operator>(const ParamValue &, const ParamValue &)
Greater than comparator (for vectors we use the size)
ValueType
Supported types for ParamValue.
Definition ParamValue.h:40
@ DOUBLE_VALUE
double value
Definition ParamValue.h:43
@ INT_LIST
integer vector
Definition ParamValue.h:45
@ STRING_VALUE
string value
Definition ParamValue.h:41
@ STRING_LIST
string vector
Definition ParamValue.h:44
@ INT_VALUE
integer value
Definition ParamValue.h:42
@ DOUBLE_LIST
double vector
Definition ParamValue.h:46
friend bool operator<(const ParamValue &, const ParamValue &)
Smaller than comparator (for vectors we use the size)
ParamValue(ParamValue &&) noexcept
Move constructor.
static const ParamValue EMPTY
Empty data value for comparisons.
Definition ParamValue.h:36
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::size_t operator()(const OpenMS::ParamValue &pv) const noexcept
Definition ParamValue.h:381