I am trying to access the graph label for a formatted input file with a dot (graphviz) using the Boost Graph library. The following is an example of typedef for a chart type:
struct DotVertex {
std::string label;
};
struct DotEdge {
std::string label;
};
struct DotGraph {
std::string label;
};
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
DotVertex, DotEdge, DotGraph> graph_t;
And this is how I assign dynamic properties:
graph_t graphviz;
boost::dynamic_properties dp(boost::ignore_other_properties);
dp.property("label", boost::get(&DotGraph::label, graphviz));
dp.property("label", boost::get(&DotVertex::label, graphviz));
dp.property("label", boost::get(&DotEdge::label, graphviz));
std::ifstream ifs("sample.dot");
bool status = boost::read_graphviz(ifs, graphviz, dp);
The compiler complains about the assignment for the label DotGraph :: with an error message:
read_graph.cc:25:30: error: no matching function for call to 'get' dp.property("label", boost::get(&DotGraph::label, graphviz));
Can someone point out what is a convenient way to read the chart label in this case? Thank!
source
share