On Mon, 2004-11-08 at 11:32, Doug Gregor wrote:
A property writer is passed the output stream and the descriptor, so you want to write Component_Writer like so:
class Component_Writer { public: typedef boost::graph_traits
::vertex_descriptor Vertex_Type; Component_Writer(const Graph_Type& g) : g(g) {}
void operator()(std::ostream& out, Vertex_Type v) { boost::shared_ptr<Component> obj_ptr = get(vertex_name, g, v); // code from before... } };
Ignore previous email. My graph stores the parent type, Component, while
the actual type is either A or B. So my ability to store them by the
Component type alone will not work since the class contains a pure
virtual function.
Its still balking at compile time. I have changed the Component_Writer
but I get the following compile error. The file is attached.
Stephen
------------------
g++ -g -Wall -o graph_test2 graph_test2.cpp
/usr/include/boost/graph/graphviz.hpp: In function `void
boost::write_graphviz(std::ostream&, const Graph&,
VertexPropertiesWriter,
EdgePropertiesWriter, GraphPropertiesWriter) [with Graph =
boost::adjacency_list &, void*
const&)'
graph_test2.cpp:260: error: candidates are: void
Component_Writer::operator()(std::ostream&, void*&) const --
Email: storri@torri.org