|
RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
|
A variant type that can hold values of different types. More...
#include <UVariant.h>
Public Types | |
| enum | Type { kBool , kChar , kUChar , kShort , kUShort , kInt , kUInt , kFloat , kDouble , kStr , kCharArray , kUCharArray , kShortArray , kUShortArray , kIntArray , kUIntArray , kFloatArray , kDoubleArray , kUndef } |
| Enumeration of supported data types. More... | |
Public Member Functions | |
| UVariant () | |
| Default constructor Creates an undefined variant. | |
| UVariant (const bool &value) | |
| Constructor from bool. | |
| UVariant (const signed char &value) | |
| Constructor from signed char. | |
| UVariant (const unsigned char &value) | |
| Constructor from unsigned char. | |
| UVariant (const short &value) | |
| Constructor from short. | |
| UVariant (const unsigned short &value) | |
| Constructor from unsigned short. | |
| UVariant (const int &value) | |
| Constructor from int. | |
| UVariant (const unsigned int &value) | |
| Constructor from unsigned int. | |
| UVariant (const float &value) | |
| Constructor from float. | |
| UVariant (const double &value) | |
| Constructor from double. | |
| UVariant (const char *value) | |
| Constructor from C string. | |
| UVariant (const std::string &value) | |
| Constructor from std::string. | |
| UVariant (const std::vector< signed char > &value) | |
| Constructor from array of signed char. | |
| UVariant (const std::vector< unsigned char > &value) | |
| Constructor from array of unsigned char. | |
| UVariant (const std::vector< short > &value) | |
| Constructor from array of short. | |
| UVariant (const std::vector< unsigned short > &value) | |
| Constructor from array of unsigned short. | |
| UVariant (const std::vector< int > &value) | |
| Constructor from array of int. | |
| UVariant (const std::vector< unsigned int > &value) | |
| Constructor from array of unsigned int. | |
| UVariant (const std::vector< float > &value) | |
| Constructor from array of float. | |
| UVariant (const std::vector< double > &value) | |
| Constructor from array of double. | |
| Type | type () const |
| Get the type of the stored value. | |
| bool | isUndef () const |
| Check if the variant is undefined. | |
| bool | isBool () const |
| Check if the variant is a bool. | |
| bool | isChar () const |
| Check if the variant is a signed char. | |
| bool | isUChar () const |
| Check if the variant is an unsigned char. | |
| bool | isShort () const |
| Check if the variant is a short. | |
| bool | isUShort () const |
| Check if the variant is an unsigned short. | |
| bool | isInt () const |
| Check if the variant is an int. | |
| bool | isUInt () const |
| Check if the variant is an unsigned int. | |
| bool | isFloat () const |
| Check if the variant is a float. | |
| bool | isDouble () const |
| Check if the variant is a double. | |
| bool | isStr () const |
| Check if the variant is a string. | |
| bool | isCharArray () const |
| Check if the variant is an array of signed char. | |
| bool | isUCharArray () const |
| Check if the variant is an array of unsigned char. | |
| bool | isShortArray () const |
| Check if the variant is an array of short. | |
| bool | isUShortArray () const |
| Check if the variant is an array of unsigned short. | |
| bool | isIntArray () const |
| Check if the variant is an array of int. | |
| bool | isUIntArray () const |
| Check if the variant is an array of unsigned int. | |
| bool | isFloatArray () const |
| Check if the variant is an array of float. | |
| bool | isDoubleArray () const |
| Check if the variant is an array of double. | |
| bool | toBool () const |
| Convert the variant to bool. | |
| signed char | toChar (bool *ok=0) const |
| Convert the variant to signed char. | |
| unsigned char | toUChar (bool *ok=0) const |
| Convert the variant to unsigned char. | |
| short | toShort (bool *ok=0) const |
| Convert the variant to short. | |
| unsigned short | toUShort (bool *ok=0) const |
| Convert the variant to unsigned short. | |
| int | toInt (bool *ok=0) const |
| Convert the variant to int. | |
| unsigned int | toUInt (bool *ok=0) const |
| Convert the variant to unsigned int. | |
| float | toFloat (bool *ok=0) const |
| Convert the variant to float. | |
| double | toDouble (bool *ok=0) const |
| Convert the variant to double. | |
| std::string | toStr (bool *ok=0) const |
| Convert the variant to string. | |
| std::vector< signed char > | toCharArray (bool *ok=0) const |
| Convert the variant to 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. | |
| std::vector< unsigned short > | toUShortArray (bool *ok=0) const |
| Convert the variant to array of unsigned short. | |
| std::vector< int > | toIntArray (bool *ok=0) const |
| Convert the variant to array of int. | |
| std::vector< unsigned int > | toUIntArray (bool *ok=0) const |
| Convert the variant to array of unsigned int. | |
| std::vector< float > | toFloatArray (bool *ok=0) const |
| Convert the variant to array of float. | |
| std::vector< double > | toDoubleArray (bool *ok=0) const |
| Convert the variant to array of double. | |
| virtual | ~UVariant () |
| Virtual destructor. | |
A variant type that can hold values of different types.
UVariant is a type-safe container that can store values of various types including booleans, integers, floats, strings, and arrays. It provides methods to check the stored type and convert to other types.
Definition at line 53 of file UVariant.h.
| enum UVariant::Type |
Enumeration of supported data types.
Definition at line 60 of file UVariant.h.
| UVariant::UVariant | ( | const bool & | value | ) |
Constructor from bool.
| value | the boolean value |
| UVariant::UVariant | ( | const signed char & | value | ) |
Constructor from signed char.
| value | the signed char value |
| UVariant::UVariant | ( | const unsigned char & | value | ) |
Constructor from unsigned char.
| value | the unsigned char value |
| UVariant::UVariant | ( | const short & | value | ) |
Constructor from short.
| value | the short value |
| UVariant::UVariant | ( | const unsigned short & | value | ) |
Constructor from unsigned short.
| value | the unsigned short value |
| UVariant::UVariant | ( | const int & | value | ) |
Constructor from int.
| value | the integer value |
| UVariant::UVariant | ( | const unsigned int & | value | ) |
Constructor from unsigned int.
| value | the unsigned integer value |
| UVariant::UVariant | ( | const float & | value | ) |
Constructor from float.
| value | the float value |
| UVariant::UVariant | ( | const double & | value | ) |
Constructor from double.
| value | the double value |
| UVariant::UVariant | ( | const char * | value | ) |
Constructor from C string.
| value | the C string value |
| UVariant::UVariant | ( | const std::string & | value | ) |
Constructor from std::string.
| value | the string value |
| UVariant::UVariant | ( | const std::vector< signed char > & | value | ) |
Constructor from array of signed char.
| value | the array of signed char |
| UVariant::UVariant | ( | const std::vector< unsigned char > & | value | ) |
Constructor from array of unsigned char.
| value | the array of unsigned char |
| UVariant::UVariant | ( | const std::vector< short > & | value | ) |
Constructor from array of short.
| value | the array of short |
| UVariant::UVariant | ( | const std::vector< unsigned short > & | value | ) |
Constructor from array of unsigned short.
| value | the array of unsigned short |
| UVariant::UVariant | ( | const std::vector< int > & | value | ) |
Constructor from array of int.
| value | the array of int |
| UVariant::UVariant | ( | const std::vector< unsigned int > & | value | ) |
Constructor from array of unsigned int.
| value | the array of unsigned int |
| UVariant::UVariant | ( | const std::vector< float > & | value | ) |
Constructor from array of float.
| value | the array of float |
| UVariant::UVariant | ( | const std::vector< double > & | value | ) |
Constructor from array of double.
| value | the array of double |
|
inlinevirtual |
Virtual destructor.
Definition at line 450 of file UVariant.h.
|
inline |
Get the type of the stored value.
Definition at line 206 of file UVariant.h.
|
inline |
Check if the variant is undefined.
Definition at line 212 of file UVariant.h.
|
inline |
Check if the variant is a bool.
Definition at line 218 of file UVariant.h.
|
inline |
Check if the variant is a signed char.
Definition at line 224 of file UVariant.h.
|
inline |
Check if the variant is an unsigned char.
Definition at line 230 of file UVariant.h.
|
inline |
Check if the variant is a short.
Definition at line 236 of file UVariant.h.
|
inline |
Check if the variant is an unsigned short.
Definition at line 242 of file UVariant.h.
|
inline |
Check if the variant is an int.
Definition at line 248 of file UVariant.h.
|
inline |
Check if the variant is an unsigned int.
Definition at line 254 of file UVariant.h.
|
inline |
Check if the variant is a float.
Definition at line 260 of file UVariant.h.
|
inline |
Check if the variant is a double.
Definition at line 266 of file UVariant.h.
|
inline |
Check if the variant is a string.
Definition at line 272 of file UVariant.h.
|
inline |
Check if the variant is an array of signed char.
Definition at line 278 of file UVariant.h.
|
inline |
Check if the variant is an array of unsigned char.
Definition at line 284 of file UVariant.h.
|
inline |
Check if the variant is an array of short.
Definition at line 290 of file UVariant.h.
|
inline |
Check if the variant is an array of unsigned short.
Definition at line 296 of file UVariant.h.
|
inline |
Check if the variant is an array of int.
Definition at line 302 of file UVariant.h.
|
inline |
Check if the variant is an array of unsigned int.
Definition at line 308 of file UVariant.h.
|
inline |
Check if the variant is an array of float.
Definition at line 314 of file UVariant.h.
|
inline |
Check if the variant is an array of double.
Definition at line 320 of file UVariant.h.
| bool UVariant::toBool | ( | ) | const |
Convert the variant to bool.
| signed char UVariant::toChar | ( | bool * | ok = 0 | ) | const |
Convert the variant to signed char.
| ok | pointer to bool to indicate success (optional) |
| unsigned char UVariant::toUChar | ( | bool * | ok = 0 | ) | const |
Convert the variant to unsigned char.
| ok | pointer to bool to indicate success (optional) |
| short UVariant::toShort | ( | bool * | ok = 0 | ) | const |
Convert the variant to short.
| ok | pointer to bool to indicate success (optional) |
| unsigned short UVariant::toUShort | ( | bool * | ok = 0 | ) | const |
Convert the variant to unsigned short.
| ok | pointer to bool to indicate success (optional) |
| int UVariant::toInt | ( | bool * | ok = 0 | ) | const |
Convert the variant to int.
| ok | pointer to bool to indicate success (optional) |
| unsigned int UVariant::toUInt | ( | bool * | ok = 0 | ) | const |
Convert the variant to unsigned int.
| ok | pointer to bool to indicate success (optional) |
| float UVariant::toFloat | ( | bool * | ok = 0 | ) | const |
Convert the variant to float.
| ok | pointer to bool to indicate success (optional) |
| double UVariant::toDouble | ( | bool * | ok = 0 | ) | const |
Convert the variant to double.
| ok | pointer to bool to indicate success (optional) |
| std::string UVariant::toStr | ( | bool * | ok = 0 | ) | const |
Convert the variant to string.
| ok | pointer to bool to indicate success (optional) |
| std::vector< signed char > UVariant::toCharArray | ( | bool * | ok = 0 | ) | const |
Convert the variant to array of signed char.
| ok | pointer to bool to indicate success (optional) |
| std::vector< unsigned char > UVariant::toUCharArray | ( | bool * | ok = 0 | ) | const |
Convert the variant to array of unsigned char.
| ok | pointer to bool to indicate success (optional) |
| std::vector< short > UVariant::toShortArray | ( | bool * | ok = 0 | ) | const |
Convert the variant to array of short.
| ok | pointer to bool to indicate success (optional) |
| std::vector< unsigned short > UVariant::toUShortArray | ( | bool * | ok = 0 | ) | const |
Convert the variant to array of unsigned short.
| ok | pointer to bool to indicate success (optional) |
| std::vector< int > UVariant::toIntArray | ( | bool * | ok = 0 | ) | const |
Convert the variant to array of int.
| ok | pointer to bool to indicate success (optional) |
| std::vector< unsigned int > UVariant::toUIntArray | ( | bool * | ok = 0 | ) | const |
Convert the variant to array of unsigned int.
| ok | pointer to bool to indicate success (optional) |
| std::vector< float > UVariant::toFloatArray | ( | bool * | ok = 0 | ) | const |
Convert the variant to array of float.
| ok | pointer to bool to indicate success (optional) |
| std::vector< double > UVariant::toDoubleArray | ( | bool * | ok = 0 | ) | const |
Convert the variant to array of double.
| ok | pointer to bool to indicate success (optional) |