Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
utilite
include
rtabmap
utilite
UVariant.h
Go to the documentation of this file.
1
/*
2
* utilite is a cross-platform library with
3
* useful utilities for fast and small developing.
4
* Copyright (C) 2010 Mathieu Labbe
5
*
6
* utilite is free library: you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* utilite is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef UVARIANT_H
21
#define UVARIANT_H
22
23
#include "
rtabmap/utilite/UtiLiteExp.h
"
// DLL export/import defines
24
#include <string>
25
#include <vector>
26
30
class
UTILITE_EXP
UVariant
31
{
32
public
:
33
enum
Type
{
34
kBool
,
35
kChar
,
36
kUChar
,
37
kShort
,
38
kUShort
,
39
kInt
,
40
kUInt
,
41
kFloat
,
42
kDouble
,
43
kStr
,
44
kUndef
45
};
46
public
:
47
UVariant
();
48
UVariant
(
const
bool
& value);
49
UVariant
(
const
char
& value);
50
UVariant
(
const
unsigned
char
& value);
51
UVariant
(
const
short
& value);
52
UVariant
(
const
unsigned
short
& value);
53
UVariant
(
const
int
& value);
54
UVariant
(
const
unsigned
int
& value);
55
UVariant
(
const
float
& value);
56
UVariant
(
const
double
& value);
57
UVariant
(
const
char
* value);
58
UVariant
(
const
std::string & value);
59
60
Type
type
()
const
{
return
type_;}
61
62
bool
isUndef
()
const
{
return
type_ == kUndef;}
63
bool
isBool
()
const
{
return
type_ == kBool;}
64
bool
isChar
()
const
{
return
type_ == kChar;}
65
bool
isUChar
()
const
{
return
type_ == kUChar;}
66
bool
isShort
()
const
{
return
type_ == kShort;}
67
bool
isUShort
()
const
{
return
type_ == kUShort;}
68
bool
isInt
()
const
{
return
type_ == kInt;}
69
bool
isUInt
()
const
{
return
type_ == kUInt;}
70
bool
isFloat
()
const
{
return
type_ == kFloat;}
71
bool
isDouble
()
const
{
return
type_ == kDouble;}
72
bool
isStr
()
const
{
return
type_ == kStr;}
73
74
bool
toBool()
const
;
75
char
toChar(
bool
* ok = 0)
const
;
76
unsigned
char
toUChar(
bool
* ok = 0)
const
;
77
short
toShort(
bool
* ok = 0)
const
;
78
unsigned
short
toUShort(
bool
* ok = 0)
const
;
79
int
toInt(
bool
* ok = 0)
const
;
80
unsigned
int
toUInt(
bool
* ok = 0)
const
;
81
float
toFloat(
bool
* ok = 0)
const
;
82
double
toDouble(
bool
* ok = 0)
const
;
83
std::string toStr(
bool
* ok = 0)
const
;
84
85
virtual
~UVariant
() {}
86
87
private
:
88
Type
type_
;
89
std::vector<unsigned char>
data_
;
90
};
91
92
#endif
/* UVARIANT_H */
UVariant::isShort
bool isShort() const
Definition:
UVariant.h:66
UVariant::kUChar
Definition:
UVariant.h:36
UVariant::isBool
bool isBool() const
Definition:
UVariant.h:63
UTILITE_EXP
#define UTILITE_EXP
Definition:
UtiLiteExp.h:33
UVariant
Definition:
UVariant.h:30
UVariant::isUShort
bool isUShort() const
Definition:
UVariant.h:67
UVariant::~UVariant
virtual ~UVariant()
Definition:
UVariant.h:85
UVariant::kUShort
Definition:
UVariant.h:38
UVariant::kDouble
Definition:
UVariant.h:42
UtiLiteExp.h
UVariant::isFloat
bool isFloat() const
Definition:
UVariant.h:70
UVariant::data_
std::vector< unsigned char > data_
Definition:
UVariant.h:89
UVariant::kChar
Definition:
UVariant.h:35
UVariant::kUInt
Definition:
UVariant.h:40
UVariant::kInt
Definition:
UVariant.h:39
UVariant::isInt
bool isInt() const
Definition:
UVariant.h:68
UVariant::isStr
bool isStr() const
Definition:
UVariant.h:72
UVariant::isDouble
bool isDouble() const
Definition:
UVariant.h:71
UVariant::isUInt
bool isUInt() const
Definition:
UVariant.h:69
UVariant::kFloat
Definition:
UVariant.h:41
UVariant::isUChar
bool isUChar() const
Definition:
UVariant.h:65
UVariant::Type
Type
Definition:
UVariant.h:33
UVariant::isChar
bool isChar() const
Definition:
UVariant.h:64
UVariant::type_
Type type_
Definition:
UVariant.h:88
UVariant::isUndef
bool isUndef() const
Definition:
UVariant.h:62
UVariant::type
Type type() const
Definition:
UVariant.h:60
UVariant::kShort
Definition:
UVariant.h:37
UVariant::kStr
Definition:
UVariant.h:43
UVariant::kBool
Definition:
UVariant.h:34
rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:37:06