14 static void *
copyValue(
const Value &value);
25 EitherType::operator
unsigned long int()
const {
42 delete (
const bool *)
value_;
45 delete (
const unsigned *)
value_;
48 delete (
const unsigned long int *)
value_;
51 delete (
const int *)
value_;
54 delete (
const long int *)
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";
109 switch (value.
type()) {
158 if (&value !=
this) {
161 void **ptValue =
const_cast<void **
>(&
value_);
212 "value is not an unsigned int");
218 "value is not an unsigned long int");
235 result = *((
const float *)
value_);
243 result = *((
const double *)
value_);
260 "value is not a Eigen matrixXd");
266 "value is not a Eigen matrix4d");
272 "value is not a vector of Value");
278 "value is not a vector of Value");
284 return std::string(
"bool");
286 return std::string(
"unsigned int");
288 return std::string(
"unsigned long int");
290 return std::string(
"int");
292 return std::string(
"float");
294 return std::string(
"double");
296 return std::string(
"string");
298 return std::string(
"vector");
300 return std::string(
"matrixXd");
302 return std::string(
"matrix4d");
304 return std::string(
"values");
306 return std::string(
"unknown");
312 switch (value.
type_) {
346 for (std::size_t i = 0; i < vals.size(); ++i)
347 os <<
"Value(" << vals[i] <<
"), ";
Values valuesValue() const
std::string stringValue() const
double doubleValue() const
unsigned unsignedValue() const
This class implements a variant design pattern to handle basic types in Command.
const Values & constValuesValue() const
Eigen::Matrix4d matrix4dValue() const
unsigned long int unsignedlongintValue() const
long int longintValue() const
Vector vectorValue() const
EitherType(const Value &value)
Value operator=(const Value &value)
Abstract root class for all dynamic-graph exceptions.
DYNAMIC_GRAPH_DLLAPI friend std::ostream & operator<<(std::ostream &os, const Value &value)
Output in a stream.
bool operator==(const Value &other) const
static void * copyValue(const Value &value)
Type type() const
Return the type of the value.
std::vector< Value > Values
const EitherType value() const
Eigen::MatrixXd matrixXdValue() const
static std::string typeName(Type type)
Return the name of the type.