7 #ifndef DYNAMIC_GRAPH_VALUE_H 8 #define DYNAMIC_GRAPH_VALUE_H 10 #include "dynamic-graph/dynamic-graph-api.h" 12 #include <dynamic-graph/linear-algebra.h> 20 typedef std::vector<Value> Values;
26 operator bool()
const;
27 operator unsigned()
const;
29 operator float()
const;
30 operator double()
const;
31 operator std::string()
const;
32 operator Vector()
const;
33 operator Eigen::MatrixXd()
const;
34 operator Eigen::Matrix4d()
const;
35 operator Values()
const;
46 class DYNAMIC_GRAPH_DLLAPI
Value {
64 explicit Value(
const bool &value);
65 explicit Value(
const unsigned &value);
66 explicit Value(
const int &value);
67 explicit Value(
const float &value);
68 explicit Value(
const double &value);
69 explicit Value(
const std::string &value);
70 explicit Value(
const Vector &value);
71 explicit Value(
const Eigen::MatrixXd &value);
72 explicit Value(
const Eigen::Matrix4d &value);
73 explicit Value(
const Values &value);
81 bool operator==(
const Value &other)
const;
98 static std::string typeName(Type type);
101 DYNAMIC_GRAPH_DLLAPI
friend std::ostream &operator<<(std::ostream &os,
106 bool boolValue()
const;
107 unsigned unsignedValue()
const;
108 int intValue()
const;
109 float floatValue()
const;
110 double doubleValue()
const;
111 std::string stringValue()
const;
112 Vector vectorValue()
const;
113 Eigen::MatrixXd matrixXdValue()
const;
114 Eigen::Matrix4d matrix4dValue()
const;
115 Values valuesValue()
const;
116 const Values &constValuesValue()
const;
118 const void *
const value_;
126 static const Value::Type TypeID;
131 #endif // DYNAMIC_GRAPH_VALUE_H This class implements a variant design pattern to handle basic types in Command.