ROSE  0.11.145.0
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G > Class Template Reference

Description

template<class G>
class Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >

Base class for generating GraphViz output.

The G template parameter is the type of graph for which output is being generated. G must be a Sawyer::Container::Graph type.

Definition at line 141 of file GraphViz.h.

#include <Rose/BinaryAnalysis/Partitioner2/GraphViz.h>

Inheritance diagram for Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >:
Collaboration graph
[legend]

Classes

struct  PseudoEdge
 

Public Types

typedef G Graph
 
typedef std::vector< OrganizationVertexOrganization
 Organizational information for vertices. More...
 
typedef std::vector< OrganizationEdgeOrganization
 Organizational information for edges. More...
 
typedef Sawyer::Container::Map< std::string, OrganizationSubgraphOrganization
 Organizational information for subgraphs. More...
 

Public Member Functions

 BaseEmitter ()
 Default constructor. More...
 
 BaseEmitter (const Graph &g)
 Constructor. More...
 
void graph (const Graph &g)
 Reset the graph. More...
 
void selectAll (bool b=true)
 Causes all vertices and edges to be selected. More...
 
void selectNone ()
 Deselects all vertices and edges. More...
 
void selectAllVertices (bool b=true)
 Causes all vertices to be selected. More...
 
void selectAllEdges (bool b=true)
 Causes all edges to be selected. More...
 
void deselectParallelEdges ()
 Deselect all but one parallel edge. More...
 
virtual void emit (std::ostream &) const
 Dump selected vertices, edges, and subgraphs. More...
 
AttributesdefaultGraphAttributes ()
 Property: default graph attributes. More...
 
const AttributesdefaultGraphAttributes () const
 Property: default graph attributes. More...
 
AttributesdefaultNodeAttributes ()
 Property: default graph node attributes. More...
 
const AttributesdefaultNodeAttributes () const
 Property: default graph node attributes. More...
 
AttributesdefaultEdgeAttributes ()
 Property: default graph edge attributes. More...
 
const AttributesdefaultEdgeAttributes () const
 Property: default graph edge attributes. More...
 
const Color::HSVsubgraphColor () const
 Property: color to use for function subgraph background.
 
void subgraphColor (const Color::HSV &bg)
 Property: color to use for function subgraph background.
 
const VertexOrganizationvertexOrganization () const
 Property: Controls which vertices are to appear in the output, and how. More...
 
VertexOrganizationvertexOrganization ()
 Property: Controls which vertices are to appear in the output, and how. More...
 
const OrganizationvertexOrganization (size_t vertexId) const
 Property: Controls which vertices are to appear in the output, and how. More...
 
OrganizationvertexOrganization (size_t vertexId)
 Property: Controls which vertices are to appear in the output, and how. More...
 
const OrganizationvertexOrganization (const typename G::ConstVertexIterator &vertex) const
 Property: Controls which vertices are to appear in the output, and how. More...
 
const OrganizationvertexOrganization (const typename G::Vertex &vertex) const
 Property: Controls which vertices are to appear in the output, and how. More...
 
OrganizationvertexOrganization (const typename G::ConstVertexIterator &vertex)
 Property: Controls which vertices are to appear in the output, and how. More...
 
OrganizationvertexOrganization (const typename G::Vertex &vertex)
 Property: Controls which vertices are to appear in the output, and how. More...
 
const EdgeOrganizationedgeOrganization () const
 Property: Controls which edges are to appear in the output, and how. More...
 
EdgeOrganizationedgeOrganization ()
 Property: Controls which edges are to appear in the output, and how. More...
 
const OrganizationedgeOrganization (size_t edgeId) const
 Property: Controls which edges are to appear in the output, and how. More...
 
OrganizationedgeOrganization (size_t edgeId)
 Property: Controls which edges are to appear in the output, and how. More...
 
const OrganizationedgeOrganization (const typename G::ConstEdgeIterator &edge) const
 Property: Controls which edges are to appear in the output, and how. More...
 
const OrganizationedgeOrganization (const typename G::Edge &edge) const
 Property: Controls which edges are to appear in the output, and how. More...
 
OrganizationedgeOrganization (const typename G::ConstEdgeIterator &edge)
 Property: Controls which edges are to appear in the output, and how. More...
 
OrganizationedgeOrganization (const typename G::Edge &edge)
 Property: Controls which edges are to appear in the output, and how. More...
 
const SubgraphOrganizationsubgraphOrganization () const
 Property: Controls which subgraphs appear in the output, and how. More...
 
SubgraphOrganizationsubgraphOrganization ()
 Property: Controls which subgraphs appear in the output, and how. More...
 
const OrganizationsubgraphOrganization (const std::string &name) const
 Property: Controls which subgraphs appear in the output, and how. More...
 
OrganizationsubgraphOrganization (const std::string &name)
 Property: Controls which subgraphs appear in the output, and how. More...
 

Protected Types

typedef Sawyer::Container::Map< size_t, size_t > VMap
 

Protected Member Functions

size_t emitVertex (std::ostream &, const typename G::ConstVertexIterator &, const Organization &, const VMap &) const
 Emit a single vertex if it hasn't been emitted already. More...
 
void emitEdge (std::ostream &, const typename G::ConstEdgeIterator &, const Organization &, const VMap &) const
 Emit a single edge. More...
 

Protected Attributes

Graph graph_
 
VertexOrganization vertexOrganization_
 
EdgeOrganization edgeOrganization_
 
SubgraphOrganization subgraphOrganization_
 
Attributes defaultGraphAttributes_
 
Attributes defaultNodeAttributes_
 
Attributes defaultEdgeAttributes_
 
std::list< PseudoEdgepseudoEdges_
 
Color::HSV subgraphColor_
 

Member Typedef Documentation

Organizational information for vertices.

Definition at line 146 of file GraphViz.h.

Organizational information for edges.

Definition at line 149 of file GraphViz.h.

Organizational information for subgraphs.

Definition at line 152 of file GraphViz.h.

Constructor & Destructor Documentation

Default constructor.

Construct a GraphViz emitter having an empty graph. The graph method can be called to give the emitter a new graph later.

Definition at line 182 of file GraphViz.h.

template<class G>
Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::BaseEmitter ( const Graph &  g)
inlineexplicit

Constructor.

Construct a generator for the specified graph. The graph is copied into this generator.

Definition at line 187 of file GraphViz.h.

Member Function Documentation

template<class G>
void Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::graph ( const Graph &  g)
inline
template<class G>
Attributes& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::defaultGraphAttributes ( )
inline

Property: default graph attributes.

Attributes that should apply to the graph as a whole.

Definition at line 208 of file GraphViz.h.

template<class G>
const Attributes& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::defaultGraphAttributes ( ) const
inline

Property: default graph attributes.

Attributes that should apply to the graph as a whole.

Definition at line 211 of file GraphViz.h.

template<class G>
Attributes& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::defaultNodeAttributes ( )
inline

Property: default graph node attributes.

Attributes that should apply to all graph nodes.

Definition at line 221 of file GraphViz.h.

template<class G>
const Attributes& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::defaultNodeAttributes ( ) const
inline

Property: default graph node attributes.

Attributes that should apply to all graph nodes.

Definition at line 224 of file GraphViz.h.

template<class G>
Attributes& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::defaultEdgeAttributes ( )
inline

Property: default graph edge attributes.

Attributes that should apply to all graph edges.

Definition at line 234 of file GraphViz.h.

template<class G>
const Attributes& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::defaultEdgeAttributes ( ) const
inline

Property: default graph edge attributes.

Attributes that should apply to all graph edges.

Definition at line 237 of file GraphViz.h.

template<class G>
const VertexOrganization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::vertexOrganization ( ) const
inline

Property: Controls which vertices are to appear in the output, and how.

Each vertex of the graph has an entry in this table, and the entry describes such things as whether the vertex will be present in the GraphViz file, which subgraph (if any) it will belong to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 259 of file GraphViz.h.

Referenced by Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< ControlFlowGraph >::vertexOrganization().

template<class G>
VertexOrganization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::vertexOrganization ( )
inline

Property: Controls which vertices are to appear in the output, and how.

Each vertex of the graph has an entry in this table, and the entry describes such things as whether the vertex will be present in the GraphViz file, which subgraph (if any) it will belong to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 262 of file GraphViz.h.

template<class G>
const Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::vertexOrganization ( size_t  vertexId) const
inline

Property: Controls which vertices are to appear in the output, and how.

Each vertex of the graph has an entry in this table, and the entry describes such things as whether the vertex will be present in the GraphViz file, which subgraph (if any) it will belong to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 265 of file GraphViz.h.

template<class G>
Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::vertexOrganization ( size_t  vertexId)
inline

Property: Controls which vertices are to appear in the output, and how.

Each vertex of the graph has an entry in this table, and the entry describes such things as whether the vertex will be present in the GraphViz file, which subgraph (if any) it will belong to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 269 of file GraphViz.h.

template<class G>
const Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::vertexOrganization ( const typename G::ConstVertexIterator &  vertex) const
inline

Property: Controls which vertices are to appear in the output, and how.

Each vertex of the graph has an entry in this table, and the entry describes such things as whether the vertex will be present in the GraphViz file, which subgraph (if any) it will belong to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 273 of file GraphViz.h.

template<class G>
const Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::vertexOrganization ( const typename G::Vertex &  vertex) const
inline

Property: Controls which vertices are to appear in the output, and how.

Each vertex of the graph has an entry in this table, and the entry describes such things as whether the vertex will be present in the GraphViz file, which subgraph (if any) it will belong to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 276 of file GraphViz.h.

template<class G>
Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::vertexOrganization ( const typename G::ConstVertexIterator &  vertex)
inline

Property: Controls which vertices are to appear in the output, and how.

Each vertex of the graph has an entry in this table, and the entry describes such things as whether the vertex will be present in the GraphViz file, which subgraph (if any) it will belong to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 279 of file GraphViz.h.

template<class G>
Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::vertexOrganization ( const typename G::Vertex &  vertex)
inline

Property: Controls which vertices are to appear in the output, and how.

Each vertex of the graph has an entry in this table, and the entry describes such things as whether the vertex will be present in the GraphViz file, which subgraph (if any) it will belong to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 282 of file GraphViz.h.

template<class G>
const EdgeOrganization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::edgeOrganization ( ) const
inline

Property: Controls which edges are to appear in the output, and how.

Each edge of the CFG has an entry in this table, and the entry describes such things as whether the edge will be present in the GraphViz file, which subgraph (if any) it belongs to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 297 of file GraphViz.h.

Referenced by Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< ControlFlowGraph >::edgeOrganization().

template<class G>
EdgeOrganization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::edgeOrganization ( )
inline

Property: Controls which edges are to appear in the output, and how.

Each edge of the CFG has an entry in this table, and the entry describes such things as whether the edge will be present in the GraphViz file, which subgraph (if any) it belongs to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 300 of file GraphViz.h.

template<class G>
const Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::edgeOrganization ( size_t  edgeId) const
inline

Property: Controls which edges are to appear in the output, and how.

Each edge of the CFG has an entry in this table, and the entry describes such things as whether the edge will be present in the GraphViz file, which subgraph (if any) it belongs to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 303 of file GraphViz.h.

template<class G>
Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::edgeOrganization ( size_t  edgeId)
inline

Property: Controls which edges are to appear in the output, and how.

Each edge of the CFG has an entry in this table, and the entry describes such things as whether the edge will be present in the GraphViz file, which subgraph (if any) it belongs to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 307 of file GraphViz.h.

template<class G>
const Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::edgeOrganization ( const typename G::ConstEdgeIterator &  edge) const
inline

Property: Controls which edges are to appear in the output, and how.

Each edge of the CFG has an entry in this table, and the entry describes such things as whether the edge will be present in the GraphViz file, which subgraph (if any) it belongs to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 311 of file GraphViz.h.

template<class G>
const Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::edgeOrganization ( const typename G::Edge &  edge) const
inline

Property: Controls which edges are to appear in the output, and how.

Each edge of the CFG has an entry in this table, and the entry describes such things as whether the edge will be present in the GraphViz file, which subgraph (if any) it belongs to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 314 of file GraphViz.h.

template<class G>
Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::edgeOrganization ( const typename G::ConstEdgeIterator &  edge)
inline

Property: Controls which edges are to appear in the output, and how.

Each edge of the CFG has an entry in this table, and the entry describes such things as whether the edge will be present in the GraphViz file, which subgraph (if any) it belongs to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 317 of file GraphViz.h.

template<class G>
Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::edgeOrganization ( const typename G::Edge &  edge)
inline

Property: Controls which edges are to appear in the output, and how.

Each edge of the CFG has an entry in this table, and the entry describes such things as whether the edge will be present in the GraphViz file, which subgraph (if any) it belongs to, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 320 of file GraphViz.h.

template<class G>
const SubgraphOrganization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::subgraphOrganization ( ) const
inline

Property: Controls which subgraphs appear in the output, and how.

Each subgraph has a distinct name consisting of only letters, numbers, and underscores. The table contains information about whether the subgraph is selected for output, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 335 of file GraphViz.h.

template<class G>
SubgraphOrganization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::subgraphOrganization ( )
inline

Property: Controls which subgraphs appear in the output, and how.

Each subgraph has a distinct name consisting of only letters, numbers, and underscores. The table contains information about whether the subgraph is selected for output, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 338 of file GraphViz.h.

template<class G>
const Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::subgraphOrganization ( const std::string &  name) const
inline

Property: Controls which subgraphs appear in the output, and how.

Each subgraph has a distinct name consisting of only letters, numbers, and underscores. The table contains information about whether the subgraph is selected for output, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 341 of file GraphViz.h.

template<class G>
Organization& Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::subgraphOrganization ( const std::string &  name)
inline

Property: Controls which subgraphs appear in the output, and how.

Each subgraph has a distinct name consisting of only letters, numbers, and underscores. The table contains information about whether the subgraph is selected for output, its label, and other attributes.

Most GraphViz-emitting methods modify this information and then call the basic emit method. In general, if the user supplies a label or attribute prior to such calls then that information is used instead of calculating new information.

Definition at line 344 of file GraphViz.h.

template<class G>
void Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::selectAll ( bool  b = true)
inline

Causes all vertices and edges to be selected.

Causes all vertices and edges to be selected as the core part of the graph. If b is false then all vertices and edges are deselected instead.

Definition at line 353 of file GraphViz.h.

template<class G>
void Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::selectNone ( )
inline

Deselects all vertices and edges.

Definition at line 359 of file GraphViz.h.

template<class G>
void Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::selectAllVertices ( bool  b = true)
inline

Causes all vertices to be selected.

Causes all vertices to be selected as the core part of the graph. If b is false then all vertices are deselected instead.

Definition at line 369 of file GraphViz.h.

Referenced by Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< ControlFlowGraph >::selectAll(), and Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< ControlFlowGraph >::selectNone().

template<class G>
void Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::selectAllEdges ( bool  b = true)
inline

Causes all edges to be selected.

Causes all edges to be selected as the core part of the graph. If b is false then all edges are deselected instead.

Definition at line 378 of file GraphViz.h.

Referenced by Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< ControlFlowGraph >::selectAll(), and Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< ControlFlowGraph >::selectNone().

template<class G >
void Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::deselectParallelEdges ( )

Deselect all but one parallel edge.

For parallel edges between a pair of vertices, all but one is deselected. Which one remains selected is arbitrary.

Definition at line 995 of file GraphViz.h.

template<class G >
void Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::emit ( std::ostream &  out) const
virtual

Dump selected vertices, edges, and subgraphs.

This is the most basic emitter that produces an entire GraphViz file. The graph will contain the selected vertices and edges organized into subgraphs according to the vertex, edge, and subgraph organization information.

Definition at line 927 of file GraphViz.h.

References Rose::BinaryAnalysis::Partitioner2::GraphViz::escape(), Sawyer::Container::Map< K, T, Cmp, Alloc >::exists(), Sawyer::Container::Map< K, T, Cmp, Alloc >::insert(), Rose::BinaryAnalysis::Partitioner2::GraphViz::Organization::isSelected(), Rose::StringUtility::numberToString(), Rose::BinaryAnalysis::Partitioner2::GraphViz::Organization::subgraph(), and Rose::BinaryAnalysis::Partitioner2::GraphViz::toString().

template<class G>
size_t Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::emitVertex ( std::ostream &  out,
const typename G::ConstVertexIterator &  vertex,
const Organization org,
const VMap vmap 
) const
protected
template<class G>
void Rose::BinaryAnalysis::Partitioner2::GraphViz::BaseEmitter< G >::emitEdge ( std::ostream &  out,
const typename G::ConstEdgeIterator &  edge,
const Organization org,
const VMap vmap 
) const
protected

The documentation for this class was generated from the following file: