[graph] Custom Selectors

Hi Guys, Is there a definitive guide in the Boost.Graph documentation about how to create custom selectors? I'm particularly interested in selectors that return STL types that use a different allocator parameter. How about a selector that chooses an STL vector using the Boost.Pool allocator, or a selector that chooses an STL set using the Boost.Pool Fast Allocator? I've gone through the BGL book (which is a bit dated, though still very much relevant) but I haven't seen a discussion about custom selectors. Pointers would be most appreciated. Have a great day everyone! -- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://cplusplus-soup.blogspot.com/] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]

Nevermind, I've found it in the online documentation: http://www.boost.org/libs/graph/doc/using_adjacency_list.html#sec:custom-sto... -- sorry for the noise. On Dec 19, 2007 2:16 PM, Dean Michael Berris <mikhailberis@gmail.com> wrote:
Hi Guys,
Is there a definitive guide in the Boost.Graph documentation about how to create custom selectors? I'm particularly interested in selectors that return STL types that use a different allocator parameter. How about a selector that chooses an STL vector using the Boost.Pool allocator, or a selector that chooses an STL set using the Boost.Pool Fast Allocator?
I've gone through the BGL book (which is a bit dated, though still very much relevant) but I haven't seen a discussion about custom selectors.
Pointers would be most appreciated.
Have a great day everyone!
-- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://cplusplus-soup.blogspot.com/] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]
-- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://cplusplus-soup.blogspot.com/] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]

--- Dean Michael Berris wrote:
Hi Guys,
Kumusta ka, pare!
Is there a definitive guide in the Boost.Graph documentation about how to create custom selectors?
Try: <http://www.boost.org/libs/graph/doc/using_adjacency_list.html#sec:custom-storage> HTH, Cromwell D. Enage ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Hey! On Dec 20, 2007 3:04 AM, Cromwell Enage <sponage@yahoo.com> wrote:
--- Dean Michael Berris wrote:
Hi Guys,
Kumusta ka, pare!
I'm good. :)
Is there a definitive guide in the Boost.Graph documentation about how to create custom selectors?
Try:
<http://www.boost.org/libs/graph/doc/using_adjacency_list.html#sec:custom-storage>
I tried this, but I got a bunch of errors. Basically, what I tried precisely are: struct pooled_vectorS { }; // the selector namespace boost { template <typename ValueType> struct container_gen<pooled_vectorS, ValueType> { typedef std::vector<ValueType, pool_allocator<ValueType> > type; }; }; Unfortunately, when I try to do: typedef adjacency_list< pooled_vectorS, pooled_vectorS, undirectedS, property<vector_name_t, int, property<vector_distance_t, int, property<vector_color_t, int> > >
graph_type;
graph_type my_graph; I get a whole slew of errors which all boils down to: /usr/local/lib/boost/boost/graph/adjacency_list.hpp:282: error: no type named 'type' in 'struct boost::parallel_edge_traits<pooled_vectorS>' Am I missing something here? I'm using the version in r41409. -- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://cplusplus-soup.blogspot.com/] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]

On Dec 19, 2007 9:03 PM, Dean Michael Berris <mikhailberis@gmail.com> wrote:
Hey!
On Dec 20, 2007 3:04 AM, Cromwell Enage <sponage@yahoo.com> wrote:
--- Dean Michael Berris wrote:
Hi Guys,
Kumusta ka, pare!
I'm good. :)
Is there a definitive guide in the Boost.Graph documentation about how to create custom selectors?
Try:
<http://www.boost.org/libs/graph/doc/using_adjacency_list.html#sec:custom-storage>
I tried this, but I got a bunch of errors. Basically, what I tried precisely are:
struct pooled_vectorS { }; // the selector
namespace boost { template <typename ValueType> struct container_gen<pooled_vectorS, ValueType> { typedef std::vector<ValueType, pool_allocator<ValueType> > type; }; };
Unfortunately, when I try to do:
typedef adjacency_list< pooled_vectorS, pooled_vectorS, undirectedS, property<vector_name_t, int, property<vector_distance_t, int, property<vector_color_t, int> > >
graph_type;
graph_type my_graph;
I get a whole slew of errors which all boils down to:
/usr/local/lib/boost/boost/graph/adjacency_list.hpp:282: error: no type named 'type' in 'struct boost::parallel_edge_traits<pooled_vectorS>'
Am I missing something here?
I'm using the version in r41409.
Hi Dean, See the last paragraph on the page Cromwell gave a link to above, which explains how to specialize this traits class. You probably want: template <> struct parallel_edge_traits<pooled_vectorS> { typedef allow_parallel_edge_tag type; }; Regards, Aaron

On Dec 20, 2007 10:47 AM, Aaron Windsor <aaron.windsor@gmail.com> wrote:
See the last paragraph on the page Cromwell gave a link to above, which explains how to specialize this traits class. You probably want:
template <> struct parallel_edge_traits<pooled_vectorS> { typedef allow_parallel_edge_tag type; };
<slaps head> Okay, thank you very much. I did miss that. Thanks very much! -- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://cplusplus-soup.blogspot.com/] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]
participants (3)
-
Aaron Windsor
-
Cromwell Enage
-
Dean Michael Berris