A type pbg knows nothing about?
My function returns to python a type pbg knows nothing about. How do I handle this?
My function will return a boost::
Here's what I tried:
-- br.h --
#include <boost/random.hpp>
#include <boost/
typedef boost::mt19937 rng_t;
namespace ublas = boost::
struct boost_uniform_
boost:
boost_
gen (r, boost::
int Generate1 () { return gen(); }
ublas:
ublas:
for (ublas:
*i = Generate1();
return out;
}
};
--
== br.py ==
from pybindgen import *
import sys
mod = Module ('br')
mod.add_include ('"br.h"')
rng = mod.add_
rng.add_
rng.add_method ('operator()', ReturnValue.new ('int'), [], custom_
u = mod.add_class ('boost_
u.add_constructor ([param ('rng_t', 'rng'), param ('int', 'min'), param ('int', 'max')])
u.add_method ('Generate1', retval ('int'), [])
u.add_method ('Generate<
mod.generate (open ('br.cc', 'w'))
File "<stdin>", line 13, in <module>
File "/usr/lib/
meth = CppMethod(*args, **kwargs)
File "/usr/lib/
return_value = utils.eval_
File "/usr/lib/
TypeLookupE
File "/usr/lib/
return callable(*args, **kwargs)
File "/usr/lib/
return_
File "/usr/lib/
raise TypeLookupError
pybindgen.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- PyBindGen Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was reopened
- by nbecker
Can you help with this problem?
Provide an answer of your own, or ask nbecker for more information if necessary.