14 static void *
copyValue(
const Value &value);
23 EitherType::operator bool()
const {
return value_->
boolValue(); }
24 EitherType::operator std::uint32_t()
const {
return value_->unsignedValue(); }
25 EitherType::operator std::uint64_t()
const {
26 return value_->unsignedlongintValue();
28 EitherType::operator std::int32_t()
const {
return value_->intValue(); }
29 EitherType::operator std::int64_t()
const {
return value_->longintValue(); }
30 EitherType::operator float()
const {
return value_->floatValue(); }
31 EitherType::operator double()
const {
return value_->doubleValue(); }
32 EitherType::operator std::string()
const {
return value_->stringValue(); }
33 EitherType::operator
Vector()
const {
return value_->vectorValue(); }
34 EitherType::operator Eigen::MatrixXd()
const {
return value_->matrixXdValue(); }
36 EitherType::operator Eigen::Matrix4d()
const {
return value_->matrix4dValue(); }
37 EitherType::operator
Values()
const {
return value_->valuesValue(); }
42 delete (
const bool *)
value_;
45 delete (
const std::uint32_t *)
value_;
48 delete (
const std::uint64_t *)
value_;
51 delete (
const std::int32_t *)
value_;
54 delete (
const std::int64_t *)
value_;
57 delete (
const float *)
value_;
60 delete (
const double *)
value_;
63 delete (
const std::string *)
value_;
69 delete (
const Eigen::MatrixXd *)
value_;
72 delete (
const Eigen::Matrix4d *)
value_;
80 throw "Value::deleteValue : Undefined type";
87 Value::Value(
const bool &value) : type_(BOOL), value_(new bool(value)) {}
89 : type_(UNSIGNED), value_(new std::uint32_t(value)) {}
91 : type_(UNSIGNEDLONGINT), value_(new std::uint64_t(value)) {}
93 : type_(INT), value_(new std::int32_t(value)) {}
95 : type_(LONGINT), value_(new int64_t(value)) {}
96 Value::Value(
const float &value) : type_(FLOAT), value_(new float(value)) {}
97 Value::Value(
const double &value) : type_(DOUBLE), value_(new double(value)) {}
99 : type_(STRING), value_(new std::string(value)) {}
102 : type_(MATRIX), value_(new
Eigen::MatrixXd(value)) {}
104 : type_(MATRIX4D), value_(new
Eigen::Matrix4d(value)) {}
108 : type_(value.type_), value_(
copyValue(value)) {}
112 switch (value.
type()) {
161 if (&
value !=
this) {
164 void **ptValue =
const_cast<void **
>(&
value_);
215 "value is not an unsigned int");
221 "value is not an unsigned long int");
238 result = *((
const float *)
value_);
246 result = *((
const double *)
value_);
263 "value is not a Eigen matrixXd");
269 "value is not a Eigen matrix4d");
275 "value is not a vector of Value");
281 "value is not a vector of Value");
287 return std::string(
"bool");
289 return std::string(
"unsigned int");
291 return std::string(
"unsigned long int");
293 return std::string(
"int");
295 return std::string(
"float");
297 return std::string(
"double");
299 return std::string(
"string");
301 return std::string(
"vector");
303 return std::string(
"matrixXd");
305 return std::string(
"matrix4d");
307 return std::string(
"values");
309 return std::string(
"unknown");
315 switch (value.
type_) {
349 for (std::size_t i = 0; i < vals.size(); ++i)
350 os <<
"Value(" << vals[i] <<
"), ";