[C++-sig] splitting a module definition over several cpp files

Matthew Scouten matthew.scouten at gmail.com
Tue Sep 25 17:33:42 CEST 2007


Ah yes that worked. thanks

On 9/24/07, Alex Mohr <amohr at pixar.com> wrote:
> Matthew Scouten wrote:
> > The library I am trying to wrap is of unwieldy size.
> >
> > I would like to split my boost python "declarations" in to several
> > different cpp files.
> > This does not work.
> >
> > I know I saw a way to do this somewhere, but I cannot find it now.
> > Somthing invloling a function called from the end of '//first code'
> > that contained '//second code'.
> > I think the 'scope()' function may have been involved.
>
> Probably the simplest thing to do is to just call functions from a
> central module definition.  e.g.
>
> //file 1
> BOOST_PYTHON_MODULE(poc)
> {
>     wrapFoo();
>     wrapBar();
>     wrapBaz();
> }
>
> //file 2
> void wrapFoo() {
>     class_<...>(...);
> }
>
> //file 3
> void wrapBar() {
>     class_<...>(...);
> }
>
> //file 4
> void wrapBaz() {
>     class_<...>(...);
> }
>
> Alex
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>



More information about the Cplusplus-sig mailing list