[C++-sig] Anyone tried BGL with BoostPython 2 yet?

David Abrahams dave at boost-consulting.com
Sun Sep 29 20:05:03 CEST 2002


From: "Robert Oschler" <robertoschler at hotmail.com>
> From: "David Abrahams" <dave at boost-consulting.com>

>
> > People asked about this with Boost.Python v1, too. I think the biggest
> > problem you'll find is that BGL is about compile-time genericity and
> Python
> > is about runtime genericity. You could easily  map the BGL's genericity
> > into Python, but that'd be best done by rewriting it in Python. Of
course,
> > then you'd give up most of the speed.
> >
> > Wrapping individual algorithms specialized to operate on specific graph
> > structures with Boost.Python should be easy, of course, and the
algorithms
> > would run fast. You could think about building graphs with internal
> > property maps that contain a boost::python::object for each
edge/vertex.
> > That might be an approach which allows some compromises.
> >
>
> My question was poorly phrased.  I'm going to write a specific data
> structure "housing module" that will use graph structures for encoding
> complex data structures.

Out of curiosity: what are you doing, large-scale architecture?

> I will use the BGL for managing the data structure
> queries, but Python will only see the "housing module" classes and method
> calls which I hope to expose via the Boost Python wrappers.  Python will
not
> talk to the BGL directly at all.  My question was more to do with someone
> using the BGL within a Boost extensions module, and any possible
conflicts
> or caveats that may come from attempting that, not with trying to wrap
the
> BGL itself for general Python access.  Sorry for the confusion.

It shouldn't cause any problems, as I am using BGL within the Boost.Python
library implementation.


-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave at boost-consulting.com * http://www.boost-consulting.com







More information about the Cplusplus-sig mailing list