7 #include <dynamic-graph/signal.h>
9 #include <boost/python.hpp>
10 #include <boost/python/stl_iterator.hpp>
19 using ::dynamicgraph::SignalBase;
30 return Value(bp::extract<bool>(o));
31 case (Value::UNSIGNED):
32 return Value(bp::extract<unsigned>(o));
33 case (Value::UNSIGNEDLONGINT):
34 return Value(bp::extract<std::uint64_t>(o));
36 return Value(bp::extract<int>(o));
37 case (Value::LONGINT):
38 return Value(bp::extract<std::int64_t>(o));
40 return Value(bp::extract<float>(o));
42 return Value(bp::extract<double>(o));
44 return Value(bp::extract<std::string>(o));
48 return Value(bp::extract<Vector>(o));
52 return Value(bp::extract<Matrix>(o));
53 case (Value::MATRIX4D):
54 return Value(bp::extract<Eigen::Matrix4d>(o));
59 throw std::invalid_argument(
60 "not implemented: cannot create a vector of values");
63 std::cerr <<
"Only int, double and string are supported." << std::endl;
70 switch (
value.type()) {
72 return bp::object(
value.boolValue());
73 case (Value::UNSIGNED):
74 return bp::object(
value.unsignedValue());
75 case (Value::UNSIGNEDLONGINT):
76 return bp::object(
value.unsignedlongintValue());
78 return bp::object(
value.intValue());
79 case (Value::LONGINT):
80 return bp::object(
value.longintValue());
82 return bp::object(
value.floatValue());
84 return bp::object(
value.doubleValue());
86 return bp::object(
value.stringValue());
88 return bp::object(
value.vectorValue());
90 return bp::object(
value.matrixXdValue());
91 case (Value::MATRIX4D):
92 return bp::object(
value.matrix4dValue());
93 case (Value::VALUES): {