ROSE  0.9.9.139
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 137 of file GraphViz.h.

#include <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 142 of file GraphViz.h.

Organizational information for edges.

Definition at line 145 of file GraphViz.h.

Organizational information for subgraphs.

Definition at line 148 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 178 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 183 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 204 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 207 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 217 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 220 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 230 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 233 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 255 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 258 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 261 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 265 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 269 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 272 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 275 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 278 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 293 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 296 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 299 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 303 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 307 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 310 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 313 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 316 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 331 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 334 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 337 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 340 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 349 of file GraphViz.h.

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

Deselects all vertices and edges.

Definition at line 355 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 365 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 374 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 998 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 930 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: