Warning, file /include/boost/graph/detail/read_graphviz_new.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef BOOST_READ_GRAPHVIZ_NEW_HPP
0029 #define BOOST_READ_GRAPHVIZ_NEW_HPP
0030
0031 #include <boost/ref.hpp>
0032 #include <boost/property_map/dynamic_property_map.hpp>
0033 #include <boost/graph/graph_traits.hpp>
0034 #include <boost/detail/workaround.hpp>
0035 #include <algorithm>
0036 #include <string>
0037 #include <vector>
0038 #include <set>
0039 #include <utility>
0040 #include <map>
0041 #include <iostream>
0042 #include <cstdlib>
0043
0044 namespace boost
0045 {
0046
0047 namespace read_graphviz_detail
0048 {
0049 typedef std::string node_name;
0050 typedef std::string subgraph_name;
0051
0052 typedef std::map< std::string, std::string > properties;
0053
0054 struct node_and_port
0055 {
0056 node_name name;
0057 std::string angle;
0058 std::vector< std::string > location;
0059
0060 friend inline bool operator==(
0061 const node_and_port& a, const node_and_port& b)
0062 {
0063 return a.name == b.name && a.angle == b.angle
0064 && a.location == b.location;
0065 }
0066
0067 friend inline bool operator<(
0068 const node_and_port& a, const node_and_port& b)
0069 {
0070 if (a.name != b.name)
0071 return a.name < b.name;
0072 if (a.angle != b.angle)
0073 return a.angle < b.angle;
0074 return a.location < b.location;
0075 }
0076 };
0077
0078 struct edge_info
0079 {
0080 node_and_port source;
0081 node_and_port target;
0082 properties props;
0083 };
0084
0085 struct parser_result
0086 {
0087 bool graph_is_directed;
0088 bool graph_is_strict;
0089 std::map< node_name, properties > nodes;
0090 std::vector< edge_info > edges;
0091 std::map< subgraph_name, properties > graph_props;
0092 };
0093
0094
0095 void parse_graphviz_from_string(
0096 const std::string& str, parser_result& result, bool want_directed);
0097
0098
0099 void translate_results_to_graph(
0100 const parser_result& r, ::boost::detail::graph::mutate_graph* mg);
0101
0102 }
0103
0104 namespace detail
0105 {
0106 namespace graph
0107 {
0108 BOOST_GRAPH_DECL bool read_graphviz_new(
0109 const std::string& str, boost::detail::graph::mutate_graph* mg);
0110 }
0111 }
0112
0113 template < typename MutableGraph >
0114 bool read_graphviz_new(const std::string& str, MutableGraph& graph,
0115 boost::dynamic_properties& dp, std::string const& node_id = "node_id")
0116 {
0117 boost::detail::graph::mutate_graph_impl< MutableGraph > mg(
0118 graph, dp, node_id);
0119 return detail::graph::read_graphviz_new(str, &mg);
0120 }
0121
0122 }
0123
0124 #endif