ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> cpp-sig
cpp-sig
Re: [C++-sig] splitting it into multiple pieces
by Ralf W. Grosse-Kunstleve other posts by this author
Oct 22 2002 11:33PM messages near this date
Re: [C++-sig] splitting it into multiple pieces | [C++-sig] wrapping global variables
--- greg Landrum <greglandrum@[...].com>  wrote:
>  The problem is that I've got a bunch of interconnected objects:
>  Molecules are made up of Atoms and Bonds (and have GetAtom/Bond methods)
>  Atoms and Bonds each contain a pointer back to their parent Molecule (and 
>  have GetParent methods)
>  
>  I'd like to have separate modules for Mols, Atoms and Bonds.  Can I do this 
>  given the interdependencies?

Yes, this is no problem if you are using Boost.Python V2. I do this all the
time.

>  If so, is there a convenient example laying around somewhere I can
>  look at/steal code from?

I got into the habit of binding one class per file. E.g.:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cctbx/cctbx/sgtbx/boost_python/?only_with_tag
=boost_python_v2_transition_2

The "top-level" module in this directory is sgtbx_module.cpp. This module calls
the bindings in all the other files (e.g. wrap_brick();). I am pointing you to
this directory specifically because MSVC 7 even made me split up the bindings
for one class: files space_group.cpp and space_group_2.cpp . It all works
without a problem on a variety of platforms.

Related suggestion: you could try lowering BOOST_PYTHON_MAX_ARITY and
BOOST_PYTHON_MAX_BASES (see Boost.Python configuration docs). Maybe this helps
MSVC, but I am not sure.

Ralf


__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
greg Landrum
Stefan Seefeld

Rene Rivera
Ralf W. Grosse-Kunstleve
Ralf W. Grosse-Kunstleve

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved