23#include "rtabmap/utilite/utilite_export.h"
164 UVariant(
const std::vector<unsigned char> & value);
176 UVariant(
const std::vector<unsigned short> & value);
212 bool isUndef()
const {
return type_ == kUndef;}
218 bool isBool()
const {
return type_ == kBool;}
224 bool isChar()
const {
return type_ == kChar;}
230 bool isUChar()
const {
return type_ == kUChar;}
236 bool isShort()
const {
return type_ == kShort;}
248 bool isInt()
const {
return type_ == kInt;}
254 bool isUInt()
const {
return type_ == kUInt;}
260 bool isFloat()
const {
return type_ == kFloat;}
272 bool isStr()
const {
return type_ == kStr;}
368 unsigned int toUInt(
bool * ok = 0)
const;
389 std::string
toStr(
bool * ok = 0)
const;
454 std::vector<unsigned char> data_;
A variant type that can hold values of different types.
bool isUShortArray() const
Check if the variant is an array of unsigned short.
UVariant(const char *value)
Constructor from C string.
UVariant(const std::string &value)
Constructor from std::string.
unsigned char toUChar(bool *ok=0) const
Convert the variant to unsigned char.
UVariant(const double &value)
Constructor from double.
float toFloat(bool *ok=0) const
Convert the variant to float.
bool isBool() const
Check if the variant is a bool.
UVariant(const std::vector< int > &value)
Constructor from array of int.
std::vector< double > toDoubleArray(bool *ok=0) const
Convert the variant to array of double.
bool isFloat() const
Check if the variant is a float.
UVariant(const unsigned int &value)
Constructor from unsigned int.
bool isDouble() const
Check if the variant is a double.
Type
Enumeration of supported data types.
UVariant(const unsigned short &value)
Constructor from unsigned short.
std::vector< unsigned short > toUShortArray(bool *ok=0) const
Convert the variant to array of unsigned short.
bool isInt() const
Check if the variant is an int.
double toDouble(bool *ok=0) const
Convert the variant to double.
Type type() const
Get the type of the stored value.
UVariant(const short &value)
Constructor from short.
unsigned short toUShort(bool *ok=0) const
Convert the variant to unsigned short.
bool isShort() const
Check if the variant is a short.
bool isChar() const
Check if the variant is a signed char.
UVariant(const std::vector< unsigned short > &value)
Constructor from array of unsigned short.
bool isUCharArray() const
Check if the variant is an array of unsigned char.
UVariant(const unsigned char &value)
Constructor from unsigned char.
bool isShortArray() const
Check if the variant is an array of short.
std::string toStr(bool *ok=0) const
Convert the variant to string.
UVariant(const std::vector< unsigned char > &value)
Constructor from array of unsigned char.
UVariant(const std::vector< signed char > &value)
Constructor from array of signed char.
UVariant(const std::vector< short > &value)
Constructor from array of short.
bool isUShort() const
Check if the variant is an unsigned short.
UVariant(const int &value)
Constructor from int.
std::vector< int > toIntArray(bool *ok=0) const
Convert the variant to array of int.
bool isFloatArray() const
Check if the variant is an array of float.
UVariant(const bool &value)
Constructor from bool.
bool isIntArray() const
Check if the variant is an array of int.
bool isDoubleArray() const
Check if the variant is an array of double.
unsigned int toUInt(bool *ok=0) const
Convert the variant to unsigned int.
signed char toChar(bool *ok=0) const
Convert the variant to signed char.
bool isUndef() const
Check if the variant is undefined.
int toInt(bool *ok=0) const
Convert the variant to int.
UVariant(const float &value)
Constructor from float.
bool isCharArray() const
Check if the variant is an array of signed char.
std::vector< unsigned char > toUCharArray(bool *ok=0) const
Convert the variant to array of unsigned char.
std::vector< short > toShortArray(bool *ok=0) const
Convert the variant to array of short.
UVariant(const std::vector< float > &value)
Constructor from array of float.
short toShort(bool *ok=0) const
Convert the variant to short.
std::vector< float > toFloatArray(bool *ok=0) const
Convert the variant to array of float.
std::vector< unsigned int > toUIntArray(bool *ok=0) const
Convert the variant to array of unsigned int.
UVariant(const std::vector< double > &value)
Constructor from array of double.
UVariant(const std::vector< unsigned int > &value)
Constructor from array of unsigned int.
UVariant(const signed char &value)
Constructor from signed char.
std::vector< signed char > toCharArray(bool *ok=0) const
Convert the variant to array of signed char.
bool isUInt() const
Check if the variant is an unsigned int.
virtual ~UVariant()
Virtual destructor.
bool toBool() const
Convert the variant to bool.
UVariant()
Default constructor Creates an undefined variant.
bool isUIntArray() const
Check if the variant is an array of unsigned int.
bool isStr() const
Check if the variant is a string.
bool isUChar() const
Check if the variant is an unsigned char.