Greetings
I am boost.python newbie. I tried searching the web for a solution but
could not find one.
I am trying to generate Python Bindings for a C++ API. The API has
some data structures with a set function pointers as its members.
struct foo {
public:
int a, b;
char *str;
int (*func1) (
Not in any straight forward way. C++ function pointers need to exist at
compile time, while python functions do not exist till runtime.
You might have a few work abounds, depending on use.
The most obvious is to hardwire the pointers to known c++ functions that
call python functions after some k
On Tue, 2010-03-02 at 16:39 +0530, puneet goel wrote:
> Greetings
>
> I am boost.python newbie. I tried searching the web for a solution but
> could not find one.
> I am trying to generate Python Bindings for a C++ API. The API has
> some data structures with a set function pointers as its members
Mathew/Jim
> If you just need your Python interface to support calling those function
> pointers, not adding new functions in Python, it's relatively easy.
Thanks for your support.
Actually I need to pass data from Python to C++. I am required to
pass Python functions as part of the structure i
On 03/02/2010 09:18 PM, puneet goel wrote:
Mathew/Jim
If you just need your Python interface to support calling those function
pointers, not adding new functions in Python, it's relatively easy.
Thanks for your support.
Actually I need to pass data from Python to C++. I am required
On Wed, 2010-03-03 at 07:48 +0530, puneet goel wrote:
> Mathew/Jim
>
> > If you just need your Python interface to support calling those function
> > pointers, not adding new functions in Python, it's relatively easy.
>
> Thanks for your support.
>
> Actually I need to pass data from Python to C
> boost::python::object - it's just a smart pointer to an arbitrary Python
> object (in the Python C-API, it's PyObject*). It overloads operator()
> to invoke the underlying Python object's __call__ method, and it's
> templated to take a reasonable number of arbitrarily typed arguments,
> convert