boost-python: exposing constructor with an array of other class asargument

E

Ester Lopez

Hello there,

I have two different classes that I want to expose using boost-python,
but the constructor of the second class takes and array of the first
one as argument and I can't figure out how to do it.

This is the definition of the classes:

class INT96{
public:
uint64_t value[3];
INT96(){};
INT96(uint64_t x0, uint64_t x1, uint64_t x2);
...
};
template <unsigned k>
class Xi_CW{
protected:
INT96 A[k];
public:
Xi_CW(INT96 (&A)[k]);
...
};

And my attempt to expose them using boost-python:

using namespace boost::python;
typedef Xi_CW<4> Xi_CW4;
BOOST_PYTHON_MODULE(xis)
{
class_<INT96>("INT96", init<double,double,double>())
[...]
;
class_<Xi_CW4>("Xi_CW4", init<INT96[4]>())
[...]
;
}

Which results in a "no known conversion error". I've tried several
other possibilities but so far no luck...

Any idea how should I do it? Thanks

Ester
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,965
Messages
2,570,148
Members
46,710
Latest member
FredricRen

Latest Threads

Top