#include <OpenMS/DATASTRUCTURES/DataValue.h>
Public Types | |
enum | DataType { STRING_VALUE, INT_VALUE, DOUBLE_VALUE, EMPTY_VALUE } |
Supported types for DataValue. More... | |
Public Member Functions | |
DataType | valueType () const |
returns the type of value stored | |
DataValue & | operator= (const DataValue &) |
assignment operator | |
bool | isEmpty () const |
test if the value is empty | |
Coinstructors and destructors | |
DataValue () | |
default constructor | |
DataValue (const char *) | |
specific constructor for char* (converted to string) | |
DataValue (const String &) | |
specific constructor for String | |
DataValue (DoubleReal) | |
specific constructor for DoubleReal | |
DataValue (Real) | |
specific constructor for Real | |
DataValue (Int) | |
specific constructor for Int | |
DataValue (UInt) | |
specific constructor for UInt | |
DataValue (const DataValue &) | |
copy constructor | |
virtual | ~DataValue () |
destructor | |
cast operators | |
These methods are used when the DataType is known. If they are applied to a DataValue with the wrong DataType, an exception is thrown. | |
operator std::string () const throw (Exception::ConversionError) | |
conversion operator to string | |
operator DoubleReal () const throw (Exception::ConversionError) | |
conversion operator to double | |
operator Real () const throw (Exception::ConversionError) | |
conversion operator to float | |
operator Int () const throw (Exception::ConversionError) | |
conversion operator to int | |
operator UInt () const throw (Exception::ConversionError) | |
conversion operator to unsigned int | |
const char * | toChar () const throw (Exception::ConversionError) |
Convert DataValues to char*. | |
conversion operators | |
These methods can be used independent of the DataType. If you already know the DataType, you should use a cast operator! For conversion of string DataValues to numeric types, first use toString() and then the conversion methods of String. | |
String | toString () const |
Conversion to String. | |
QString | toQString () const |
Conversuin to QString. | |
Static Public Attributes | |
static const DataValue | EMPTY |
Empty data value for comparisons. | |
Protected Attributes | |
DataType | value_type_ |
Type of the currently stored value. | |
union { | |
PointerSizeInt int_ | |
DoubleReal dou_ | |
String * str_ | |
} | data_ |
Friends | |
std::ostream & | operator<< (std::ostream &, const DataValue &) |
output stream operator | |
bool | operator== (const DataValue &, const DataValue &) |
Equality comparator. | |
bool | operator!= (const DataValue &, const DataValue &) |
Equality comparator. |
enum DataType |
DataValue | ( | ) |
default constructor
DataValue | ( | const char * | ) |
specific constructor for char* (converted to string)
DataValue | ( | DoubleReal | ) |
specific constructor for DoubleReal
virtual ~DataValue | ( | ) | [virtual] |
destructor
operator std::string | ( | ) | const throw (Exception::ConversionError) |
conversion operator to string
operator DoubleReal | ( | ) | const throw (Exception::ConversionError) |
conversion operator to double
operator Real | ( | ) | const throw (Exception::ConversionError) |
conversion operator to float
operator Int | ( | ) | const throw (Exception::ConversionError) |
conversion operator to int
operator UInt | ( | ) | const throw (Exception::ConversionError) |
conversion operator to unsigned int
const char* toChar | ( | ) | const throw (Exception::ConversionError) |
QString toQString | ( | ) | const |
Conversuin to QString.
DataType valueType | ( | ) | const [inline] |
returns the type of value stored
bool isEmpty | ( | ) | const [inline] |
test if the value is empty
std::ostream& operator<< | ( | std::ostream & | , | |
const DataValue & | ||||
) | [friend] |
output stream operator
DataType value_type_ [protected] |
Type of the currently stored value.
union { ... } data_ [protected] |
Generated Tue Apr 1 15:36:43 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |