[C++-sig] Boost and wxWidgets

2010-01-13 Thread Joan Carles Jimenez
Hi. I am testing the following source code: Canvas.h #ifndef _CANVAS_H_ #define _CANVAS_H_ #include #include "wx/wx.h" class CanvasFrame { protected: wxFrame* _frame; public: CanvasFrame(const std::string& pTitle); ~CanvasFrame(

[C++-sig] A nice Boost.Python and Py++ usage example

2010-01-13 Thread Roman Yakovenko
http://frontiersin.org/psychology/psychology/paper/10.3389/neuro.11/011.2009/html/ The articles talks about some science fiction ( for me:-) ), but also has few paragraphs related to Boost.Python and Py++. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ __

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

2010-01-13 Thread Hans Meine
On Mittwoch 13 Januar 2010, Roman Yakovenko wrote: > On Wed, Jan 13, 2010 at 8:57 AM, blp330 wrote: > > class Document > > { > > public: > > > > > > bool operator==(const Document& other) const > > { > > return Compare(other); > > } > [...] > If I understand you right, you need: > > 1. d

Re: [C++-sig] Simple , , I think .. type conversion question C++ -> python

2010-01-13 Thread Tim Couper
Troy Thanks .. your hints are most helpful .. I'll be back :-) Tim On 13/01/2010 19:10, troy d. straszheim wrote: Tim Couper wrote: OK. Here's what I've been stuck with all today .. I have a 3rd party C++ program function which returns a boost::variant (and its inverse) my_variant my_varia

Re: [C++-sig] Simple , , I think .. type conversion question C++ -> python

2010-01-13 Thread troy d. straszheim
Tim Couper wrote: OK. Here's what I've been stuck with all today .. I have a 3rd party C++ program function which returns a boost::variant (and its inverse) my_variant my_variant_of_string(const std::string& str) This one takes a string & returns a variant, and am trying to wrap this in pyth

[C++-sig] Simple , , I think .. type conversion question C++ -> python

2010-01-13 Thread Tim Couper
OK. Here's what I've been stuck with all today .. I have a 3rd party C++ program function which returns a boost::variant (and its inverse) my_variant my_variant_of_string(const std::string& str) This one takes a string & returns a variant, and am trying to wrap this in python, so that there I

Re: [C++-sig] Conversion problem

2010-01-13 Thread Nicolas Lelong
Simon, it seems that I wrapped the same videoinput library you're using. I wrapped the getPixels the following way : python script is responsible of the memory allocation for pixels buffer (in a correctly sized string). The getPixels function is wrapped as follows : namespace { bool video

Re: [C++-sig] Conversion problem

2010-01-13 Thread Roman Yakovenko
On Wed, Jan 13, 2010 at 11:00 AM, Simon Pickles wrote: > Hello, > > I wonder if someone could help me with a tricky conversion between c++ and > python types (well, tricky for me!) > > I have a c++ library that I would like to use in python via Boost::Python > > One function fills a c++ unsigned c

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

2010-01-13 Thread Nicolas Lelong
Sending again, as my original reply apparently got lost, sorry if it didn't. IMO, the easiest route would be to wrap the member functions : namespace { std::string video_getDeviceName_wrapped(int deviceID) {   char* name = videoInput::getDeviceName(devideID);   std::string result(name);

[C++-sig] Conversion problem

2010-01-13 Thread Simon Pickles
Hello, I wonder if someone could help me with a tricky conversion between c++ and python types (well, tricky for me!) I have a c++ library that I would like to use in python via Boost::Python One function fills a c++ unsigned char* buffer. It has two overloads: unsigned char * getPixe