Re: [C++-sig] returning vector arrays and multiple values

2008-10-23 Thread Leonard Ritter
thanks for your help, the solution i used was this one: #include #include using namespace boost::python; tuple py_audio_get_recording_buffer() { int write_ptr = 0; std::vector buffer = audio_get_recording_buffer(write_ptr); return make_tuple(buffer, write_ptr); } BOOST_PYTHON_MODUL

Re: [C++-sig] Help wrapping an unconventional setter

2008-10-23 Thread Stefan Seefeld
Craig Bosma wrote: Hi, I'm pretty new to Boost.Python, and am trying to wrap a simple class similar to: class Foo { public: float value() const { return value_; } float& value() { return value_; } private: float value_; }; I have no problem wrapping value() as a read-only propert

[C++-sig] Help wrapping an unconventional setter

2008-10-23 Thread Craig Bosma
Hi, I'm pretty new to Boost.Python, and am trying to wrap a simple class similar to: class Foo { public: float value() const { return value_; } float& value() { return value_; } private: float value_; }; I have no problem wrapping value() as a read-only property, like so: class_("Foo

Re: [C++-sig] returning vector arrays and multiple values

2008-10-23 Thread Stefan Seefeld
Leonard Ritter wrote: i have a function which i wish to wrap, which returns a float buffer and an integer: std::vector get_recording_buffer(/* out */ size_t &write_ptr); alternatively, the function could also just return a pointer to a float array: const float *get_recording_buffer(/* out *

[C++-sig] returning vector arrays and multiple values

2008-10-23 Thread Leonard Ritter
i have a function which i wish to wrap, which returns a float buffer and an integer: std::vector get_recording_buffer(/* out */ size_t &write_ptr); alternatively, the function could also just return a pointer to a float array: const float *get_recording_buffer(/* out */ size_t &size, /* out */ s