Re: [C++-sig] [boost.python] How can I wrap operator==?

2010-01-12 Thread Roman Yakovenko
On Wed, Jan 13, 2010 at 8:57 AM, blp330 wrote: > > Um... Sorry, I mean I have a class Document, which defined > > class Document > { > public: >   > >  bool operator==(const Document& other) const >  { >  return Compare(other); >  } > }; > > It simply call Compare method, I need to something m

Re: [C++-sig] [boost.python] How can I wrap operator==?

2010-01-12 Thread blp330
Um... Sorry, I mean I have a class Document, which defined class Document { public: bool operator==(const Document& other) const { return Compare(other); } }; It simply call Compare method, I need to something more when I use it in python code but I don't want to change my Document c

Re: [C++-sig] Member function bp::optional? Or workaround?

2010-01-12 Thread Charles Solar
Hmm, well if the arg definition matters like you two are suggesting it does, then maybe the python code from Py++ does work. Right now it generates code that I use, but I do not include the bp::object, so my function in boost python looks like int (Foo::*bar1)( const Y*) = &Foo::bar; int (Foo::*b

Re: [C++-sig] Member function bp::optional? Or workaround?

2010-01-12 Thread Hans Meine
On Dienstag 12 Januar 2010, Charles Solar wrote: > Well I want to define the overloads myself anyway, I just do not know how > to properly setup the small wrapper that will work. Oh, OK. > In the doc it tells > you how to make flat function wrappers, but nothing on member function > wrappers. I

Re: [C++-sig] Member function bp::optional? Or workaround?

2010-01-12 Thread Roman Yakovenko
On Tue, Jan 12, 2010 at 9:46 PM, Charles Solar wrote: > And I have tried using Py++, it does not handle the default argument, it > just puts the call in there and python still requires the param to be there. Can you explain what you mean? The following code was generated by Py++: bp::class_

Re: [C++-sig] Member function bp::optional? Or workaround?

2010-01-12 Thread Charles Solar
Looks perfect, thanks much. On Tue, Jan 12, 2010 at 2:01 PM, troy d. straszheim wrote: > Charles Solar wrote: > >> Well I want to define the overloads myself anyway, I just do not know how >> to properly setup the small wrapper that will work. In the doc it tells you >> how to make flat function

Re: [C++-sig] Member function bp::optional? Or workaround?

2010-01-12 Thread troy d. straszheim
Charles Solar wrote: Well I want to define the overloads myself anyway, I just do not know how to properly setup the small wrapper that will work. In the doc it tells you how to make flat function wrappers, but nothing on member function wrappers. I am unsure how I am supposed to handle the t

Re: [C++-sig] [boost.python] How can I wrap operator==?

2010-01-12 Thread Roman Yakovenko
On Mon, Jan 11, 2010 at 6:05 AM, blp330 wrote: > > Hi, > > I want to wrap operator== for my object, Py++ generates that: > >        Document_exposer.def( bp::self != bp::self); >        Document_exposer.def( bp::self == bp::self ); > > But I want to do something more, so I try to wrap it with: > >

Re: [C++-sig] Member function bp::optional? Or workaround?

2010-01-12 Thread Charles Solar
Well I want to define the overloads myself anyway, I just do not know how to properly setup the small wrapper that will work. In the doc it tells you how to make flat function wrappers, but nothing on member function wrappers. I am unsure how I am supposed to handle the this pointer, for example.

Re: [C++-sig] Member function bp::optional? Or workaround?

2010-01-12 Thread Hans Meine
On Dienstag 12 Januar 2010, Charles Solar wrote: > I have a few default parameters in a couple of my member functions, and > these functions do not conform to the format required > forBOOST_PYTHON_MEMBER_FUNCTION_OVERLOAD.. I never use BOOST_PYTHON_MEMBER_FUNCTION_OVERLOAD anyway. You may freely

[C++-sig] Member function bp::optional? Or workaround?

2010-01-12 Thread Charles Solar
I have a few default parameters in a couple of my member functions, and these functions do not conform to the format required forBOOST_PYTHON_MEMBER_FUNCTION_OVERLOAD.. I was wondering how to go about creating those thin wrappers for these functions. For example, my class would be something like

[C++-sig] Returning a simple char *

2010-01-12 Thread Simon Pickles
Hello, I thought I was trying to do something simple. While wrapping a 3rd party library, I have a c++ class with two member function returning pointers like this: class videoInput { public: static char * getDeviceName(int deviceID); }; and a module like this: #include "boost//py