Otawa
0.10
|
#include </home/casse/otawa/otawa/src/odisplay/graphviz.h>
Public Member Functions | |
GraphVizGraph (const PropList &defaultGraphStyle=PropList::EMPTY, const PropList &defaultNodeStyle=PropList::EMPTY, const PropList &defaultEdgeStyle=PropList::EMPTY) | |
Constructs a new GraphVizGraph. More... | |
virtual String | attributes () |
calls attributes(const PropList& style) with the PropList containing the style of the item. More... | |
virtual void | setProps (const PropList &props) |
virtual Node * | newNode (const PropList &style=PropList::EMPTY, const PropList &props=PropList::EMPTY) |
This function creates a new node in the graph. More... | |
virtual Edge * | newEdge (Node *source, Node *target, const PropList &style=PropList::EMPTY, const PropList &props=PropList::EMPTY) |
This function creates a new edge between the two given nodes, in the graph. More... | |
virtual void | display (void) throw (DisplayException) |
This functions displays the graph. More... | |
Property * | getProp (const AbstractIdentifier *id) const |
Find a property by its identifier. More... | |
void | setProp (Property *prop) |
Set the property in the property list removing any double. More... | |
void | setProp (const AbstractIdentifier *id) |
void | removeProp (const AbstractIdentifier *id) |
Remove a property matching the given identifier. More... | |
void | removeProp (const AbstractIdentifier &id) |
Property * | extractProp (const AbstractIdentifier *id) |
Remove a property matching the given identifier and return it. More... | |
Property * | extractProp (const AbstractIdentifier &id) |
Remove a property matching the given identifier and return it. More... | |
void | addProp (Property *prop) |
Add property to the list without checking of duplication. More... | |
void | removeAllProp (const AbstractIdentifier *id) |
Remove all the properties matching the given identifier. More... | |
bool | hasProp (const AbstractIdentifier &id) const |
Test if the property list contains a property matching the given identifier. More... | |
void | clearProps (void) |
Remove all properties from the list. More... | |
void | addProps (const PropList &props) |
Add all properties from the given property list, in a reverse order. More... | |
void | print (elm::io::Output &out) const |
Display the current property list. More... | |
Static Public Attributes | |
static const PropList | EMPTY |
This is an empty proplist for convenience. More... | |
Protected Member Functions | |
virtual void | printOthersAttributes (elm::io::Output &out) |
Prints attributes after all the style PropList have been iterated. More... | |
virtual void | printGraphData (elm::io::Output &out) |
Prints to the given output all the data DOT needs to create the graph information. More... | |
virtual String | getPropertiesString () |
Makes a string containing the values of all properties in _props separated by newlines. More... | |
virtual String | attributes (const PropList &props) |
Prints all attributes (styles) in a string, between brackets. More... | |
virtual bool | printAttribute (elm::io::Output &out, const PropList::Iter &prop) |
Process the Property given by the iterator pointing to it. More... | |
Protected Attributes | |
elm::genstruct::FragTable < GraphVizNode * > | _nodes |
list of nodes in the graph More... | |
elm::genstruct::FragTable < GraphVizEdge * > | _edges |
list of edges in the graph More... | |
PropList | _default_node_style |
default style for the nodes More... | |
PropList | _default_edge_style |
default style for the edges More... | |
int | _node_count |
node count for giving a different number for each new node More... | |
PropList | _props |
Properties of the attached object. More... | |
elm::genstruct::HashTable < const AbstractIdentifier *, int > | _include |
List of properties to print. More... | |
elm::genstruct::HashTable < const AbstractIdentifier *, int > | _exclude |
List of properties to hide. More... | |
bool | _defaultInclude |
true if the default is to include all properties More... | |
This class represents the graph that will be drawn by graphviz
otawa::display::GraphVizGraph::GraphVizGraph | ( | const PropList & | defaultGraphStyle = PropList::EMPTY , |
const PropList & | defaultNodeStyle = PropList::EMPTY , |
||
const PropList & | defaultEdgeStyle = PropList::EMPTY |
||
) |
Constructs a new GraphVizGraph.
defaultGraphStyle | default properties for the graph Can be changed with the methods inherited from PropList |
defaultNodeStyle | default properties for the nodes Can be changed with the methods inherited from PropList |
defaultEdgeStyle | default properties for the edges Can be changed with the methods inherited from PropList |
References _default_edge_style, _default_node_style, and otawa::PropList::addProps().
|
inherited |
Add property to the list without checking of duplication.
prop | Property to add. |
References otawa::Property::_next.
Referenced by otawa::Identifier< T >::add(), otawa::ast::ASTInfo::ASTInfo(), otawa::Identifier< otawa::arm::Info * >::copy(), otawa::AbstractIdentifier::initProps(), otawa::ContextualProperty::make(), otawa::script::Script::makeConfig(), otawa::ccg::Builder::processLBlockSet(), otawa::ipet::ILPSystemGetter::processWorkSpace(), otawa::Identifier< T >::ref(), otawa::ContextualProperty::ref(), and otawa::ContextualProperty::refProps().
|
inherited |
Add all properties from the given property list, in a reverse order.
props | Property list to clone. |
References copy(), otawa::PropList::head, and otawa::Property::next().
Referenced by otawa::display::CFGDrawer::CFGDrawer(), GraphVizGraph(), otawa::ParamFeature::instantiate(), otawa::Manager::loadXML(), newEdge(), newNode(), otawa::PropList::operator=(), otawa::Process::Process(), otawa::PropList::PropList(), otawa::display::GraphVizItem::setProps(), otawa::VirtualBasicBlock::VirtualBasicBlock(), and otawa::VirtualCFG::VirtualCFG().
Prints all attributes (styles) in a string, between brackets.
First iterates on the style PropList, calling printAttribute() for each property, and then, calls printOthersAttributes() to finish. This functions escapes all the newlines that have been appened in the functions printAttribute() and printOthersAttributes()
style | styles to be printed |
References buf, otawa::PropList::Iter::ended(), elm::StringBuffer::length(), otawa::display::GraphVizItem::printAttribute(), otawa::display::GraphVizItem::printOthersAttributes(), otawa::display::quoteNewlines(), and elm::StringBuffer::toString().
|
virtual |
calls attributes(const PropList& style) with the PropList containing the style of the item.
Generally, the proplist is the object itself, because it inherits from PropList
Implements otawa::display::GraphVizItem.
References otawa::display::GraphVizItem::attributes().
Referenced by printGraphData().
|
inherited |
Remove all properties from the list.
References otawa::Property::next().
Referenced by otawa::PSTBuilder::getVCFG(), otawa::PropList::operator=(), otawa::display::GraphVizItem::setProps(), otawa::PropList::~PropList(), and otawa::WorkSpace::~WorkSpace().
|
virtual |
This functions displays the graph.
Implements otawa::display::Graph.
References _, command, elm::Pair< T1, T2 >::fst, otawa::display::GRAPHVIZ_LAYOUT, otawa::display::LAYOUT_CIRCULAR, otawa::display::LAYOUT_DOT, otawa::display::LAYOUT_RADIAL, otawa::display::LAYOUT_UNDIRECTED_FDP, otawa::display::LAYOUT_UNDIRECTED_NEATO, elm::sys::SystemException::message(), out, otawa::display::OUTPUT_ANY, otawa::display::OUTPUT_DOT, otawa::display::OUTPUT_GIF, otawa::display::OUTPUT_JPG, otawa::display::OUTPUT_KIND, otawa::display::OUTPUT_PATH, otawa::display::OUTPUT_PDF, otawa::display::OUTPUT_PNG, otawa::display::OUTPUT_PS, otawa::display::OUTPUT_RAW_DOT, otawa::display::OUTPUT_SVG, printGraphData(), proc, and elm::Pair< T1, T2 >::snd.
|
inherited |
Remove a property matching the given identifier and return it.
Caller is responsible of the management of the obtained property.
id | Identifier of the property to extract. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::script::Script::makeConfig().
|
inlineinherited |
Remove a property matching the given identifier and return it.
Caller is responsible of the management of the obtained property.
id | Identifier of the property to extract. |
References otawa::PropList::extractProp().
Referenced by otawa::PropList::extractProp().
|
inherited |
Find a property by its identifier.
id | Identifier of the property to find. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::Identifier< otawa::arm::Info * >::exists(), otawa::ContextualProperty::exists(), otawa::ContextualProperty::find(), otawa::Identifier< T >::get(), otawa::PropList::hasProp(), otawa::ContextualProperty::make(), otawa::ParamFeature::matches(), otawa::ImmutableRef< T, I >::print(), otawa::ContextualProperty::print(), otawa::Identifier< T >::ref(), otawa::ContextualProperty::ref(), otawa::ContextualProperty::refProps(), otawa::Identifier< T >::set(), otawa::Identifier< T >::use(), and otawa::Identifier< T >::value().
|
protectedvirtualinherited |
Makes a string containing the values of all properties in _props separated by newlines.
References otawa::display::GraphVizItem::_defaultInclude, otawa::display::GraphVizItem::_exclude, otawa::display::GraphVizItem::_include, otawa::display::GraphVizItem::_props, buf, otawa::PropList::Iter::ended(), elm::StringBuffer::length(), elm::StringBuffer::print(), and elm::StringBuffer::toString().
Referenced by otawa::display::GraphVizNode::printOthersAttributes(), and otawa::display::GraphVizEdge::printOthersAttributes().
|
inlineinherited |
Test if the property list contains a property matching the given identifier.
id | Property identifier to look for. |
References otawa::PropList::getProp().
Referenced by otawa::ipet::BasicConstraintsBuilder::addEntryConstraint(), otawa::Monitor::configure(), otawa::ImmutableRef< T, I >::exists(), and otawa::Manager::setVerbosity().
|
virtual |
This function creates a new edge between the two given nodes, in the graph.
source | Source node of the edge. |
target | Target node of the edge. |
style | Style of the node. |
props | Properties to display. |
Implements otawa::display::Graph.
References _default_edge_style, _edges, otawa::PropList::addProps(), otawa::cfgio::edge(), otawa::display::GraphVizEdge::setProps(), otawa::cfgio::source(), and otawa::cfgio::target().
|
virtual |
This function creates a new node in the graph.
style | Style of the node. |
props | Properties to display. |
Implements otawa::display::Graph.
References _default_node_style, _node_count, _nodes, otawa::PropList::addProps(), and otawa::display::GraphVizNode::setProps().
|
inherited |
Display the current property list.
out | Output to use. |
Referenced by otawa::operator<<(), and otawa::ContextualProperty::print().
|
protectedvirtualinherited |
Process the Property given by the iterator pointing to it.
Prints the value to the given output, or store the property for example (the property can be printed furthermore by printOthersAttributes())
out | output where to print when something have to be printed iterator on properties. Used to compare the identifier and to get the property value |
Reimplemented in otawa::display::GraphVizEdge, otawa::display::GraphVizNode, and otawa::display::GraphVizGraphElement.
References otawa::display::GraphVizItem::_defaultInclude, otawa::display::GraphVizItem::_exclude, otawa::display::GraphVizItem::_include, otawa::display::BACKGROUND, otawa::display::COLOR, otawa::display::DEFAULT, otawa::display::EXCLUDE, otawa::display::HREF, otawa::display::INCLUDE, and otawa::display::quoteSpecials().
Referenced by otawa::display::GraphVizItem::attributes(), and otawa::display::GraphVizGraphElement::printAttribute().
|
protectedvirtual |
Prints to the given output all the data DOT needs to create the graph information.
References _edges, _nodes, otawa::display::GraphVizNode::attributes(), otawa::display::GraphVizEdge::attributes(), attributes(), otawa::cfgio::edge(), elm::genstruct::FragTable< T >::Iterator::ended(), elm::String::isEmpty(), otawa::display::GraphVizNode::number(), otawa::display::GraphVizEdge::source(), and otawa::display::GraphVizEdge::target().
Referenced by display().
|
protectedvirtual |
Prints attributes after all the style PropList have been iterated.
One can append endlines to the output
out | output where to print others attributes |
Reimplemented from otawa::display::GraphVizItem.
References otawa::display::BODY, and otawa::display::quoteSpecials().
|
inherited |
Remove all the properties matching the given identifier.
id | Identifier of properties to remove. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::LoopUnroller::unroll().
|
inherited |
Remove a property matching the given identifier.
id | Identifier of the property to remove. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::PSTBuilder::buildTree(), otawa::BBRemover< T >::clean(), otawa::display::CFGOutput::processCFG(), otawa::SubCFGBuilder::processWorkSpace(), otawa::Ref< T, I >::remove(), and otawa::ContextualPath::Ref< T >::remove().
|
inlineinherited |
References otawa::PropList::removeProp().
Referenced by otawa::PropList::removeProp().
|
inherited |
Set the property in the property list removing any double.
prop | Property to set. |
References otawa::Property::_next, otawa::Property::id(), and otawa::Property::next().
|
inlineinherited |
References otawa::PropList::setProp().
Referenced by otawa::PropList::setProp().
|
virtual |
Reimplemented from otawa::display::GraphVizItem.
References otawa::display::GraphVizItem::setProps().
|
protected |
default style for the edges
Referenced by GraphVizGraph(), and newEdge().
|
protected |
default style for the nodes
Referenced by GraphVizGraph(), and newNode().
|
protectedinherited |
true if the default is to include all properties
Referenced by otawa::display::GraphVizItem::getPropertiesString(), and otawa::display::GraphVizItem::printAttribute().
|
protected |
list of edges in the graph
Referenced by newEdge(), and printGraphData().
|
protectedinherited |
List of properties to hide.
If the key exists, exclude the property
Referenced by otawa::display::GraphVizItem::getPropertiesString(), and otawa::display::GraphVizItem::printAttribute().
|
protectedinherited |
List of properties to print.
If the key exists, include the property
Referenced by otawa::display::GraphVizItem::getPropertiesString(), and otawa::display::GraphVizItem::printAttribute().
|
protected |
node count for giving a different number for each new node
Referenced by newNode().
|
protected |
list of nodes in the graph
Referenced by newNode(), and printGraphData().
|
protectedinherited |
Properties of the attached object.
Referenced by otawa::display::GraphVizItem::getPropertiesString(), and otawa::display::GraphVizItem::setProps().
|
staticinherited |
This is an empty proplist for convenience.