P4C
The P4 Compiler
 
Loading...
Searching...
No Matches
graphs::Graphs Class Reference
Inheritance diagram for graphs::Graphs:

Classes

class  GraphAttributeSetter
 
struct  Vertex
 

Public Types

using edgeProperties
 
using Graph = boost::subgraph<Graph_>
 
using Graph_
 
using graphProperties
 
using GraphvizAttributes = std::map<cstring, cstring>
 
using Parents = std::vector<std::pair<vertex_t, EdgeTypeIface *>>
 
using vertex_t = boost::graph_traits<Graph>::vertex_descriptor
 
using vertexProperties = boost::property<boost::vertex_attribute_t, GraphvizAttributes, Vertex>
 
enum class  VertexType {
  TABLE , KEY , ACTION , CONDITION ,
  SWITCH , STATEMENTS , CONTROL , OTHER ,
  STATE , EMPTY
}
 

Public Member Functions

vertex_t add_and_connect_vertex (const cstring &name, VertexType type)
 
void add_edge (const vertex_t &from, const vertex_t &to, const cstring &name)
 
void add_edge (const vertex_t &from, const vertex_t &to, const cstring &name, unsigned cluster_id)
 used to connect subgraphs
 
vertex_t add_vertex (const cstring &name, VertexType type)
 
std::optional< vertex_t > merge_other_statements_into_vertex ()
 

Protected Attributes

vertex_t exit_v {}
 
Graph * g {nullptr}
 
Parents parents {}
 
vertex_t start_v {}
 
std::vector< const IR::Statement * > statementsStack {}
 

Class Documentation

◆ graphs::Graphs::Vertex

struct graphs::Graphs::Vertex
Class Members
cstring name
VertexType type

Member Typedef Documentation

◆ edgeProperties

using graphs::Graphs::edgeProperties
Initial value:
boost::property<
boost::edge_attribute_t, GraphvizAttributes,
boost::property<boost::edge_name_t, cstring, boost::property<boost::edge_index_t, int>>>

◆ Graph_

using graphs::Graphs::Graph_
Initial value:
boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
vertexProperties, edgeProperties, graphProperties>

◆ graphProperties

using graphs::Graphs::graphProperties
Initial value:
boost::property<
boost::graph_name_t, cstring,
boost::property<
boost::graph_graph_attribute_t, GraphvizAttributes,
boost::property<boost::graph_vertex_attribute_t, GraphvizAttributes,
boost::property<boost::graph_edge_attribute_t, GraphvizAttributes>>>>
Definition cstring.h:72

Member Function Documentation

◆ add_edge()

void graphs::Graphs::add_edge ( const vertex_t & from,
const vertex_t & to,
const cstring & name,
unsigned cluster_id )

used to connect subgraphs

Parameters
fromnode from wich edge will start
tonode where edge will end
nameused as edge label
cluster_idid of cluster, that will be connected to previous cluster