Boost logo

Boost Users :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2005-04-28 17:11:38


Well, the graph_traits specialization has to live in boost, but
the functions such as target can go in your own namespace, the
same namespace as your graph and edge type.

On Apr 28, 2005, at 7:12 PM, Cyrille.Damez_at_[hidden] wrote:

> On Thursday 28 April 2005 20:01, Andreas Fabri wrote:
>> Hello,
>>
>> Developping code so that BGL algorithms can run on the vertices and
>> edges of CGAL triangulations, I am wondering if there are rules or
>> recommendations for in which namespace the functions source, target,
>> vertices, out_edges ... shall go.
>>
>> In boost, because it is boostish code, or in CGAL, because that is the
>> namespace where the triangulation lives in?
>
> I did something a bit similar last year (writting a wrapper to be able
> to
> apply BGL's algorithms to the OpenMesh library). I put all the
> vertices,
> edges, etc. classes and functions in boost namespace. As far as I
> understand,
> that shouldn't cause too much problems, since all the types and
> functions I
> added in there were template specializations. That looked like :
>
> // The graph traits
> struct graph_traits<MyMesh> {
> typedef MyMesh::FaceHandle vertex_descriptor;
> typedef MyMesh::EdgeHandle edge_descriptor;
> typedef IteratorWrapper<MyMesh::ConstFaceFaceIter>
> adjacency_iterator;
> typedef CircularIteratorWrapper out_edge_iterator;
> // [...] etc
> };
>
> // Some functions specialization
> graph_traits<MyMesh>::vertex_descriptor
> target(graph_traits<MyMesh>::edge_descriptor e, const MyMesh& g)
> {
> ...
> }
>
> etc.
>
>
> Cheers
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
_______________________________________________
Jeremy Siek <jsiek_at_[hidden]>
http://www.osl.iu.edu/~jsiek
Ph.D. Student, Indiana University Bloomington
C++ Booster (http://www.boost.org)
_______________________________________________


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net