|
| void | clear () |
| | Empty the Graph. More...
|
| |
| VertexView< false > | vertices () |
| | Returns a view object allowing iteration over the vertices of the graph. More...
|
| |
| VertexView< true > | vertices () const |
| |
| EdgeView< false > | edges () |
| | Returns a view object allowing iteration over the edges of the graph. More...
|
| |
| EdgeView< true > | edges () const |
| |
| InOutEdgeView< false, true > | outEdges (const VertexIdentifier I) |
| | Returns a view object allowing iteration over the edges which start at a vertex I. More...
|
| |
| InOutEdgeView< true, true > | outEdges (const VertexIdentifier I) const |
| |
| InOutEdgeView< false, false > | inEdges (const VertexIdentifier I) |
| | Returns a view object allowing iteration over the edges which point to a vertex I. More...
|
| |
| InOutEdgeView< true, false > | inEdges (const VertexIdentifier I) const |
| |
| VertexAttribute & | operator[] (const VertexIdentifier &I) |
| | Looks up the vertex with identifier I, if it does not exist it default constructs it. More...
|
| |
| EdgeAttribute & | operator[] (const EdgeIdentifier &I) |
| | Looks up the edge with identifier I, if it does not exist it default constructs it, if it's endpoints do not exist it also default constructs them. More...
|
| |
| Expected< VertexAttribute & > | at (const VertexIdentifier &I) |
| | Looks up a vertex with Identifier I, or an error if it does not exist. More...
|
| |
| Expected< const VertexAttribute & > | at (const VertexIdentifier &I) const |
| |
| Expected< EdgeAttribute & > | at (const EdgeIdentifier &I) |
| | Looks up an edge with Identifier I, or an error if it does not exist. More...
|
| |
| Expected< const EdgeAttribute & > | at (const EdgeIdentifier &I) const |
| |
| size_type | count (const VertexIdentifier &I) const |
| | Looks for a vertex with identifier I, returns 1 if one exists, and 0 otherwise. More...
|
| |
| size_type | count (const EdgeIdentifier &I) const |
| | Looks for an edge with Identifier I, returns 1 if one exists and 0 otherwise. More...
|
| |
| std::pair< VertexIterator, bool > | insert (const std::pair< VertexIdentifier, VertexAttribute > &Val) |
| | Inserts a vertex into the graph with Identifier Val.first, and Attribute Val.second. More...
|
| |
| std::pair< VertexIterator, bool > | insert (std::pair< VertexIdentifier, VertexAttribute > &&Val) |
| |
| std::pair< EdgeIterator, bool > | insert (const std::pair< EdgeIdentifier, EdgeAttribute > &Val) |
| | Inserts an edge into the graph with Identifier Val.first, and Attribute Val.second. More...
|
| |
| std::pair< EdgeIterator, bool > | insert (std::pair< EdgeIdentifier, EdgeAttribute > &&Val) |
| | Inserts an edge into the graph with Identifier Val.first, and Attribute Val.second. More...
|
| |
template<typename VertexAttribute, typename EdgeAttribute, typename VI = int32_t>
class llvm::xray::Graph< VertexAttribute, EdgeAttribute, VI >
A Graph object represents a Directed Graph and is used in XRay to compute and store function call graphs and associated statistical information.
The graph takes in four template parameters, these are:
- VertexAttribute, this is a structure which is stored for each vertex. Must be DefaultConstructible, CopyConstructible, CopyAssignable and Destructible.
- EdgeAttribute, this is a structure which is stored for each edge Must be DefaultConstructible, CopyConstructible, CopyAssignable and Destructible.
- EdgeAttribute, this is a structure which is stored for each variable
- VI, this is a type over which DenseMapInfo is defined and is the type used look up strings, available as VertexIdentifier.
- If the built in DenseMapInfo is not defined, provide a specialization class type here.
Graph is CopyConstructible, CopyAssignable, MoveConstructible and MoveAssignable but is not EqualityComparible or LessThanComparible.
Usage Example Graph with weighted edges and vertices: Graph<int, int, int> G;
G[1] = 0; G[2] = 2; G[{1,2}] = 1; G[{2,1}] = -1; for(const auto &v : G.vertices()){ // Do something with the vertices in the graph; } for(const auto &e : G.edges()){ // Do something with the edges in the graph; }
Usage Example with StrRef keys. Graph<int, double, StrRef> StrG; char va[] = "Vertex A"; char vaa[] = "Vertex A"; char vb[] = "Vertex B"; // Vertices are referenced by String Refs. G[va] = 0; G[vb] = 1; G[{va, vb}] = 1.0; cout() << G[vaa] << " " << G[{vaa, vb}]; //prints "0 1.0".
Definition at line 75 of file Graph.h.