[C++-sig] [Boost.Python] Recommended file structure layout?

2010-01-22 Thread Daniel Lidström
Hello, I am very interested in using Boost.Python to test my C++ codebase. However, I would like to have some tips on a typical layout of the files in my project. My codebase today is completely C++-based and I also have tests using cppunit. Here's my file structure of the GFL library (Windows dll

[C++-sig] [Boost Python] Extended class loosing attributes when saving as pointer to BaseClass in C++

2010-01-22 Thread MrF
Hey, My problem is the following: I do have a C++ class, "BaseClass", that I am extending in Python ("SubClass"). Also there is another C++ class, let's call it "BaseClassManager" which has a vector of BaseClass* (well, actually it's holding shared_ptr's). Instances of "SubClass" are created

Re: [C++-sig] [Boost Python] Extended class loosing attributes when saving as pointer to BaseClass in C++

2010-01-22 Thread Jim Bosch
I think I can explain what's going on, and I've got an idea for a partial solution. But first, try making BaseClassWrap multiply inherit from BaseClass and boost::python::wrapper. That might fix everything. If not, read on... When boost::python converts a C++ value to Python, it looks up the C+

Re: [C++-sig] [Boost Python] Extended class loosing attributes when saving as pointer to BaseClass in C++

2010-01-22 Thread MrF
Thanks for help! A better solution would be to write a custom to-python conversion for shared_ptr Tried it and works perfectly. Good hint! This is probably something boost::python should do automatically if BaseClassWrap is a subclass of wrapper. If it doesn't, and you can get me a com

[C++-sig] Please help: boost python 1.41 extension problem

2010-01-22 Thread lin yun
Hi, I am trying to install boost 1.41 on Redhat Enterprise Linux 5.3 and I got problem with the extension test. Following the instructions here: http://www.boost.org/doc/libs/1_41_0/libs/python/doc/building.html - I built boost python using bjam. - cd into the libs/python/example/quickstart