CGRA-ME
|
#include <ConfigGraph.h>
Classes | |
struct | EdgeID |
struct | NameNameConfigStore |
struct | VertexID |
Public Member Functions | |
template<typename VertexList = std::vector<std::pair<std::string,ConfigStore>>, typename EdgeList = std::vector<NameNameConfigStore>> | |
ConfigGraph (std::string graph_name_={}, ConfigStore graph_attributes_={}, VertexList vertices_={}, EdgeList edges_={}) | |
const ConfigStore & | graphAttributes () const & |
void | setGraphAttributes (ConfigStore &&attrs) |
void | setGraphAttributes (const ConfigStore &attrs) |
const std::string & | graphName () const & |
void | setGraphName (const std::string &s) |
void | setGraphName (std::string &&s) |
const std::string & | name (const VertexID &v) const |
const ConfigStore & | attributes (const VertexID &v) const |
const ConfigStore & | attributes (const EdgeID &e) const |
const VertexID & | target (const EdgeID &e) const |
const VertexID & | source (const EdgeID &e) const |
VertexID | target (EdgeID &&e) const |
VertexID | source (EdgeID &&e) const |
auto | allNodes () const |
auto | outEdges (const VertexID &v) const |
auto | fanout (const VertexID &v) const |
std::pair< VertexID, bool > | insert (std::string name, ConfigStore vertex_attrs={}) |
EdgeID | link (VertexID source, VertexID target, ConfigStore edge_attrs={}) |
std::ostream & | printDot (std::ostream &os) const |
bool | empty () const |
std::ptrdiff_t | numVertices () const |
std::ptrdiff_t | numEdges () const |
Private Attributes | |
std::string | graph_name |
ConfigStore | graph_attributes |
std::map< VertexID, ConfigStore > | vertices = {} |
std::multimap< VertexID, EdgeID > | out_edges = {} |
std::map< EdgeID, ConfigStore > | edges = {} |
Friends | |
std::ostream & | operator<< (std::ostream &os, const ConfigGraph &cs) |
bool | operator== (const ConfigGraph &lhs, const ConfigGraph &rhs) |
bool | operator== (const ConfigGraph &lhs, const ConfigGraph &rhs) |
Intended to be used as an uninterpreted representation of the DOT format.
Definition at line 72 of file ConfigGraph.h.
|
inline |
General constructor. Can take a name, graph properties, 0 or more vertices, and 0 or more edges. Like the DOT format, edges will create an vertices that have not been mentioned with empty attribute list(s).
Eg. ConfigGraph("", {}, {}, {{"a","b",{{"c","d"}}}}); // digraph { a->b [c=d] } ConfigGraph("G", {{"a","b"}}, {{"v",{}}}); // digraph G { graph[a=b] v }
Definition at line 94 of file ConfigGraph.h.
|
inline |
For iterating the nodes in this graph
Definition at line 142 of file ConfigGraph.h.
|
inline |
Definition at line 129 of file ConfigGraph.h.
|
inline |
Get all attributes associated with the given vertex or edge
Definition at line 128 of file ConfigGraph.h.
|
inline |
Definition at line 240 of file ConfigGraph.h.
|
inline |
For when you just want the vertices. Note: if graph is a multi-graph, there may be duplicate entries
Definition at line 156 of file ConfigGraph.h.
|
inline |
Get/set graph's attributes
Definition at line 109 of file ConfigGraph.h.
|
inline |
Get/set graph's name
Definition at line 116 of file ConfigGraph.h.
|
inline |
Add a node to this graph. If name
is not unique, then any vertex_attrs
passed-in will be merged into the existing vertex's attributes, overriding any that share the same key. If name is not unique, the bool in the return value will be false, and the existing vertex ID will be returned. Otherwise, the Vertex ID will be for the newly added node, and the bool will be true.
Definition at line 173 of file ConfigGraph.h.
|
inline |
Add an edge to this graph. Always inserts a new edge, and the returned value will uniquely represent this edge. Call with the same source
and target
to create a multi-graph.
Definition at line 190 of file ConfigGraph.h.
|
inline |
Get the name/unique identifier for a given vertex ID
Definition at line 123 of file ConfigGraph.h.
|
inline |
Definition at line 242 of file ConfigGraph.h.
|
inline |
Definition at line 241 of file ConfigGraph.h.
|
inline |
Access to all the edges that originate at v
. Note: graph may be a multi-graph
Definition at line 148 of file ConfigGraph.h.
|
inline |
Print out the contents in DOT format. Should not loose any information; it will represent this graph exactly.
Definition at line 205 of file ConfigGraph.h.
|
inline |
Definition at line 110 of file ConfigGraph.h.
|
inline |
Definition at line 111 of file ConfigGraph.h.
|
inline |
Definition at line 117 of file ConfigGraph.h.
|
inline |
Definition at line 118 of file ConfigGraph.h.
Definition at line 135 of file ConfigGraph.h.
Definition at line 137 of file ConfigGraph.h.
Get nodes at either end of an edge
Definition at line 134 of file ConfigGraph.h.
Definition at line 136 of file ConfigGraph.h.
|
friend |
Definition at line 237 of file ConfigGraph.h.
|
friend |
|
friend |
Definition at line 292 of file ConfigGraph.h.
|
private |
Definition at line 290 of file ConfigGraph.h.
|
private |
Definition at line 286 of file ConfigGraph.h.
|
private |
Definition at line 285 of file ConfigGraph.h.
Definition at line 289 of file ConfigGraph.h.
|
private |
Definition at line 288 of file ConfigGraph.h.