[boost] boost.python, native arrays like double a[3] in classeshowto??

2003-08-14 Thread antonxx
Hi I have a class like: class MyClass { public: double myvector[3]; }; Is it possible to use it in boost.python 1.30.0? I did not find information howto do this, but I also did not find information thats its not possible. My problem I get compiler errors Could somebody clarify this?

Re: [boost] Boost.Python and BCC

2003-03-28 Thread David Abrahams
"Chris Trengove" <[EMAIL PROTECTED]> writes: > A question for David Abrahams (or anyone else who might have a bright idea). > > I have resolved quite a few of the issues involved in porting Boost.Python > to Borland, but here is one particularly nasty problem. In > member_function_cast.hpp you hav

[boost] Boost.Python and BCC

2003-03-27 Thread Chris Trengove
A question for David Abrahams (or anyone else who might have a bright idea). I have resolved quite a few of the issues involved in porting Boost.Python to Borland, but here is one particularly nasty problem. In member_function_cast.hpp you have code, which after expansion at the hands of Boost.Pre

Re: [boost] [Boost.python] Help. string heap error!

2003-02-28 Thread David Abrahams
Kim Chang Han <[EMAIL PROTECTED]> writes: > My Compiler is VC++ 6.0. > > Could you test with this compiler? > > Thanks in advance. I did (with service pack 5 installed). The directory I used is enclosed. embed.zip Description: Zip archive -- Dave Abrahams Boost Consulting www.boost-consulti

RE: [boost] [Boost.python] Help. string heap error!

2003-02-28 Thread Kim Chang Han
My Compiler is VC++ 6.0. Could you test with this compiler? Thanks in advance. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of David Abrahams Sent: Thursday, February 27, 2003 10:54 PM To: Boost mailing list Subject: Re: [boost] [Boost.python] Help

Re: [boost] [Boost.python] Help. string heap error!

2003-02-27 Thread David Abrahams
Kim Chang Han <[EMAIL PROTECTED]> writes: > Here is my simple test code modified from embedding.cpp test code(by > Dirk Gerrits). > > I successfully compiled, but my excutable raise heap error assertion > when the time freeing the string result of the function py.hello(). > > Can I prevent this er

[boost] [Boost.python] Help. string heap error!

2003-02-26 Thread Kim Chang Han
Here is my simple test code modified from embedding.cpp test code(by Dirk Gerrits). I successfully compiled, but my excutable raise heap error assertion when the time freeing the string result of the function py.hello(). Can I prevent this error? My sampel code and result is below. // mai

Re: [boost] Boost.Python, embedding and extending, exposinginstances

2002-11-25 Thread David Abrahams
[EMAIL PROTECTED] writes: > Hello, > > I'm trying to embedd and extend a C++ application. > > I was not able to find any good examples of how to do this. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/boost/boost/libs/python/test/embedding.cpp > From the small tidbits of information

[boost] Boost.Python, embedding and extending, exposing instances

2002-11-25 Thread thor . arne . johansen
Hello, I'm trying to embedd and extend a C++ application. I was not able to find any good examples of how to do this. From the small tidbits of information I found, plus browsing the Boost.Python sources, I tried the following approach (starting from the "getting_started2" example, with an added

Re: [boost] boost.python question

2002-11-13 Thread David Abrahams
gaoyakun <[EMAIL PROTECTED]> writes: > Is it possible to export my class with overloaded operator [] to python so that i >could use it as a python list? Please post Boost.Python questions to the C++-sig: http://www.python.org/sigs/c++-sig/ Your specific question is answered here: http://a

[boost] boost.python question

2002-11-13 Thread gaoyakun
Is it possible to export my class with overloaded operator [] to python so that i could use it as a python list? __ === Ãâ·ÑÊÔÓÃÐÂÀË15MÊÕ·ÑÓÊÏä ¸Ï½ôÐж¯£¡ (http://vip.sina.com/sol_mail/promoti

Re: [boost] Boost.Python

2002-11-08 Thread David Abrahams
Dan Nuffer <[EMAIL PROTECTED]> writes: > David Abrahams wrote: >> Dan Nuffer <[EMAIL PROTECTED]> writes: >>>10. I added implicitly_convertible(); It >>>compiled fine, but it didn't work: >>> >>> import owclient >>> >>> s = owclient.OW_String("a") >>> >>> s.concat(owclient.OW_String("b")) >>> >>> >

Re: [boost] boost.python

2002-11-08 Thread David Abrahams
gaoyakun <[EMAIL PROTECTED]> writes: > how can i dealing a function which returns a raw pointer? for > example: int * Foo (A_Class); > > i have tried return_value_policy(reference_existing_object) or > return_value_policy(manage_new_object) but it doesnt work.it seem's > that it only accept a poi

Re: [boost] Boost.Python

2002-11-08 Thread David Abrahams
Dan Nuffer <[EMAIL PROTECTED]> writes: > David Abrahams wrote: >> Dan Nuffer <[EMAIL PROTECTED]> writes: >>>10. I added implicitly_convertible(); It >>>compiled fine, but it didn't work: >>> >>> import owclient >>> >>> s = owclient.OW_String("a") >>> >>> s.concat(owclient.OW_String("b")) >>> >>> >

Re: [boost] Boost.Python

2002-11-08 Thread David Abrahams
Dan Nuffer <[EMAIL PROTECTED]> writes: > David Abrahams wrote: >> Dan Nuffer <[EMAIL PROTECTED]> writes: >>>6. How can I get python indexing and slicing to work on OW_String? I >>>couldn't see any information about this in the docs. >> The same way you do it in Python: supply a "__getitem__" and

Re: [boost] Boost.Python

2002-11-08 Thread David Abrahams
Dan Nuffer <[EMAIL PROTECTED]> writes: > David Abrahams wrote: >> Dan Nuffer <[EMAIL PROTECTED]> writes: >>>2. Is is possible to wrap member functions which take a variable >>>number of arguments (e.g. int format(const char* fmt, ...); ) ? I >>>tried .def("format", &OW_String::format) but that do

[boost] boost.python

2002-11-07 Thread gaoyakun
how can i dealing a function which returns a raw pointer? for example: int * Foo (A_Class); i have tried return_value_policy(reference_existing_object) or return_value_policy(manage_new_object) but it doesnt work.it seem's that it only accept a pointer of a C++ class like Foo* or Foo&.

Re: [boost] Boost.Python

2002-11-07 Thread Dan Nuffer
David Abrahams wrote: Dan Nuffer <[EMAIL PROTECTED]> writes: 10. I added implicitly_convertible(); It compiled fine, but it didn't work: >>> import owclient >>> s = owclient.OW_String("a") >>> s.concat(owclient.OW_String("b")) >>> s.c_str() 'ab' >>> s.concat("c") Traceback (most recent call last

Re: [boost] Boost.Python

2002-11-07 Thread Dan Nuffer
David Abrahams wrote: Dan Nuffer <[EMAIL PROTECTED]> writes: 8. When I exposed the OW_String(const char*) and OW_String(char) constructors, python would always call OW_String(char) instead of OW_String(const char*). Is this intentional or a bug? I just removed the OW_String(char) constructor,

Re: [boost] Boost.Python

2002-11-07 Thread Dan Nuffer
David Abrahams wrote: Dan Nuffer <[EMAIL PROTECTED]> writes: 6. How can I get python indexing and slicing to work on OW_String? I couldn't see any information about this in the docs. The same way you do it in Python: supply a "__getitem__" and a "__getslice__" method. Thanks, this works g

Re: [boost] Boost.Python

2002-11-07 Thread Dan Nuffer
David Abrahams wrote: Dan Nuffer <[EMAIL PROTECTED]> writes: 2. Is is possible to wrap member functions which take a variable number of arguments (e.g. int format(const char* fmt, ...); ) ? I tried .def("format", &OW_String::format) but that doesn't work. Not directly. Conversions from Python

Re: [boost] Boost.Python

2002-11-07 Thread Joel de Guzman
- Original Message - From: "David Abrahams" <[EMAIL PROTECTED]> > > 5. It would be nice if you gave an example in the tutorial about how > > to specify overloads, since casting the member function pointer is not > > something that is completely obvious (at least it took me a while to > >

Re: [boost] Boost.Python

2002-11-07 Thread David Abrahams
Dan Nuffer <[EMAIL PROTECTED]> writes: > Hi, > I've started using Boost.Python to wrap some classes from OpenWBEM. > So far I've got one class mostly done: OW_String. So far I have been > very impressed, and think the library is great. But I've had a few > problems. Here's some questions and com

Re: [boost] Boost.Python

2002-11-06 Thread Joel de Guzman
- Original Message - From: "Dan Nuffer" <[EMAIL PROTECTED]> Hi Dan, > 1. It took me some searching to find > BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS, I think it should be at least > mentioned in the tutorial. > 5. It would be nice if you gave an example in the tutorial about how to

[boost] Boost.Python

2002-11-06 Thread Dan Nuffer
Hi, I've started using Boost.Python to wrap some classes from OpenWBEM. So far I've got one class mostly done: OW_String. So far I have been very impressed, and think the library is great. But I've had a few problems. Here's some questions and comments: 1. It took me some searching to find