Hi all,
I am trying to define a structure Foo, containing a std::vector<double> :
class Foo {
public:
int i;
double d;
char c;
std::string s;
float f;
std::vector<double> v;
};
I have defined its serialisation function, using for its 'v' attribute
either:
ar & make_nvp("v", foo.v);
or:
ar & make_array<double>(foo.v.data(), foo.v.size()));
The first case does not compile (std::vector<double> has no member named
serialize).
The second one compiles but 'v' type is unknown in scripting :
In Task HelloWorld[S]
(type 'ls' for context info) :foo.v
Got :foo.v
= (unknown_t)
How could I link the 'v' type (std::vector<double>) to the corresponding
scripting type (array)?
Thanks,
Charles.
PS: In case someone answers typegen is the solution, I do not want to
use it ;) Actually, this code correspond to a test case for the Yarp
transport!
Defining a type owning a std::vector<double> in orocos-toolchain
Hi all,
I am trying to define a structure Foo, containing a std::vector<double> :
class Foo {
public:
int i;
double d;
char c;
std::string s;
float f;
std::vector<double> v;
};
I have defined its serialisation function, using for its 'v' attribute
either:
ar & make_nvp("v", foo.v);
or:
ar & make_array<double>(foo.v.data(), foo.v.size()));
The first case does not compile (std::vector<double> has no member named
serialize).
The second one compiles but 'v' type is unknown in scripting :
In Task HelloWorld[S]
(type 'ls' for context info) :foo.v
Got :foo.v
= (unknown_t)
How could I link the 'v' type (std::vector<double>) to the corresponding
scripting type (array)?
Thanks,
Charles.
PS: In case someone answers typegen is the solution, I do not want to
use it ;) Actually, this code correspond to a test case for the Yarp
transport!