
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<Graph_Type>::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<boost::setS, boost::setS, boost::directedS, boost::property<boost::vertex_index_t, uint32_t, boost::property<boost::vertex_name_t, boost::shared_ptr<Component>, boost::no_property> >, boost::no_property, boost::no_property, boost::listS>, VertexPropertiesWriter = Component_Writer, EdgePropertiesWriter = boost::default_writer, GraphPropertiesWriter = boost::default_writer]': /usr/include/boost/graph/graphviz.hpp:292: instantiated from `void boost::write_graphviz(std::ostream&, const Graph&, VertexWriter) [with Graph = boost::adjacency_list<boost::setS, boost::setS, boost::directedS, boost::property<boost::vertex_index_t, uint32_t, boost::property<boost::vertex_name_t, boost::shared_ptr<Component>, boost::no_property> >, boost::no_property, boost::no_property, boost::listS>, VertexWriter = Component_Writer]' graph_test2.cpp:499: instantiated from here /usr/include/boost/graph/graphviz.hpp:264: error: no match for call to `( Component_Writer) (std::basic_ostream<char, std::char_traits<char>
&, void* const&)' graph_test2.cpp:260: error: candidates are: void Component_Writer::operator()(std::ostream&, void*&) const
-- Email: storri@torri.org