Best method for storing a type in a boost graph vertex.

What is the best method for storing a type in a boost graph vertex? By value or pointer? I have the following graph type: typedef property< vertex_index_t, uint32_t, property< vertex_name_t, boost::shared_ptr<Component> > > VertexProperty; typedef adjacency_list<setS, // OutEdgeList setS, // VertexList directedS, // Directed VertexProperty> // VertexProperties Graph_Type; The Component is a class. I thought it was best to store it in the vertex as a pointer. Is this going to cause me trouble? Stephen -- Email: storri@torri.org

On Nov 8, 2004, at 12:10 AM, Stephen torri wrote:
What is the best method for storing a type in a boost graph vertex? By value or pointer?
By value is preferred. The BGL will allocate it via a pointer anyway if it needs to be.
I have the following graph type:
typedef property< vertex_index_t, uint32_t, property< vertex_name_t, boost::shared_ptr<Component> > > VertexProperty;
typedef adjacency_list<setS, // OutEdgeList setS, // VertexList directedS, // Directed VertexProperty> // VertexProperties Graph_Type;
The Component is a class. I thought it was best to store it in the vertex as a pointer. Is this going to cause me trouble?
It won't cause you trouble, but it isn't necessary, either. In 1.32.0, you'll be able to write just: typedef adjacency_list<setS, setS, directedS, Component> Graph_Type; This is the "bundled properties" feature. Doug
participants (2)
-
Doug Gregor
-
Stephen torri