Otawa  0.10
otawa::display::GraphVizEdge Class Reference

#include </home/casse/otawa/otawa/src/odisplay/graphviz.h>

Inheritance diagram for otawa::display::GraphVizEdge:
otawa::display::Edge otawa::display::GraphVizGraphElement otawa::display::Item otawa::display::GraphVizItem otawa::PropList

Public Member Functions

 GraphVizEdge (GraphVizNode *src, GraphVizNode *dest)
 Creates a new edge with the first node given as source node, and the second node as target node. More...
 
virtual GraphVizNodesource ()
 This function returns the source of this edge. More...
 
virtual GraphVizNodetarget ()
 This function returns the target of this edge. 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)
 Set the object properties that have to be printed. More...
 
PropertygetProp (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)
 
PropertyextractProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier and return it. More...
 
PropertyextractProp (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 bool printAttribute (elm::io::Output &out, const PropList::Iter &prop)
 Process the Property given by the iterator pointing to it. 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...
 

Protected Attributes

bool _hasLabel
 true if the label have been set, even if it is an empty string More...
 
String _label
 label of the edge More...
 
GraphVizNode_src
 source of the edge More...
 
GraphVizNode_dest
 target of the edge 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...
 

Detailed Description

Author
G. Cavaignac

This class represents the links between the graphviz nodes in the graphviz graph

Constructor & Destructor Documentation

otawa::display::GraphVizEdge::GraphVizEdge ( GraphVizNode src,
GraphVizNode dest 
)

Creates a new edge with the first node given as source node, and the second node as target node.

Parameters
srcsource node
desttarget node

Member Function Documentation

String otawa::display::GraphVizItem::attributes ( const PropList style)
protectedvirtualinherited

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()

Parameters
stylestyles to be printed
Returns
String containing the attributes. For example: [color="red"]

References buf, otawa::PropList::Iter::ended(), elm::StringBuffer::length(), otawa::display::GraphVizItem::printAttribute(), otawa::display::GraphVizItem::printOthersAttributes(), otawa::display::quoteNewlines(), and elm::StringBuffer::toString().

String otawa::display::GraphVizEdge::attributes ( void  )
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 otawa::display::GraphVizGraph::printGraphData().

void otawa::PropList::clearProps ( void  )
inherited
Property * otawa::PropList::extractProp ( const AbstractIdentifier id)
inherited

Remove a property matching the given identifier and return it.

Caller is responsible of the management of the obtained property.

Parameters
idIdentifier of the property to extract.

References otawa::Property::_next, and otawa::Property::next().

Referenced by otawa::script::Script::makeConfig().

Property * otawa::PropList::extractProp ( const AbstractIdentifier id)
inlineinherited

Remove a property matching the given identifier and return it.

Caller is responsible of the management of the obtained property.

Parameters
idIdentifier of the property to extract.

References otawa::PropList::extractProp().

Referenced by otawa::PropList::extractProp().

String otawa::display::GraphVizItem::getPropertiesString ( )
protectedvirtualinherited
bool otawa::PropList::hasProp ( const AbstractIdentifier id) const
inlineinherited

Test if the property list contains a property matching the given identifier.

Parameters
idProperty identifier to look for.
Returns
True if the list contains the matching property, false else.

References otawa::PropList::getProp().

Referenced by otawa::ipet::BasicConstraintsBuilder::addEntryConstraint(), otawa::Monitor::configure(), otawa::ImmutableRef< T, I >::exists(), and otawa::Manager::setVerbosity().

void otawa::PropList::print ( elm::io::Output out) const
inherited

Display the current property list.

Parameters
outOutput to use.

Referenced by otawa::operator<<(), and otawa::ContextualProperty::print().

bool otawa::display::GraphVizEdge::printAttribute ( elm::io::Output out,
const PropList::Iter prop 
)
protectedvirtual

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())

Parameters
outoutput where to print when something have to be printed iterator on properties. Used to compare the identifier and to get the property value
Returns
true if something have been written on the output, false else

Reimplemented from otawa::display::GraphVizGraphElement.

References _hasLabel, _label, otawa::Identifier< T >::get(), otawa::display::LABEL, otawa::display::GraphVizGraphElement::printAttribute(), and otawa::display::WEIGHT.

void otawa::display::GraphVizEdge::printOthersAttributes ( elm::io::Output out)
protectedvirtual

Prints attributes after all the style PropList have been iterated.

One can append endlines to the output

Parameters
outoutput where to print others attributes

Reimplemented from otawa::display::GraphVizItem.

References _hasLabel, _label, otawa::display::GraphVizItem::getPropertiesString(), elm::String::length(), and otawa::display::quoteSpecials().

void otawa::PropList::removeAllProp ( const AbstractIdentifier id)
inherited

Remove all the properties matching the given identifier.

Parameters
idIdentifier of properties to remove.

References otawa::Property::_next, and otawa::Property::next().

Referenced by otawa::LoopUnroller::unroll().

void otawa::PropList::removeProp ( const AbstractIdentifier id)
inherited
void otawa::PropList::removeProp ( const AbstractIdentifier id)
inlineinherited
void otawa::PropList::setProp ( Property prop)
inherited

Set the property in the property list removing any double.

Parameters
propProperty to set.

References otawa::Property::_next, otawa::Property::id(), and otawa::Property::next().

void otawa::PropList::setProp ( const AbstractIdentifier id)
inlineinherited
void otawa::display::GraphVizEdge::setProps ( const PropList props)
virtual

Set the object properties that have to be printed.

Parameters
propsSet the properties to print.

Implements otawa::display::Item.

References otawa::display::GraphVizItem::setProps().

Referenced by otawa::display::GraphVizGraph::newEdge().

otawa::display::GraphVizEdge::source ( void  )
inlinevirtual

This function returns the source of this edge.

Returns
source of this edge

References _src.

Referenced by otawa::display::GraphVizGraph::printGraphData().

otawa::display::GraphVizEdge::target ( void  )
inlinevirtual

This function returns the target of this edge.

Returns
target of this edge

References _dest.

Referenced by otawa::display::GraphVizGraph::printGraphData().

Member Data Documentation

bool otawa::display::GraphVizItem::_defaultInclude
protectedinherited

true if the default is to include all properties

Referenced by otawa::display::GraphVizItem::getPropertiesString(), and otawa::display::GraphVizItem::printAttribute().

GraphVizNode* otawa::display::GraphVizEdge::_dest
protected

target of the edge

Referenced by target().

elm::genstruct::HashTable<const AbstractIdentifier*, int> otawa::display::GraphVizItem::_exclude
protectedinherited

List of properties to hide.

If the key exists, exclude the property

Referenced by otawa::display::GraphVizItem::getPropertiesString(), and otawa::display::GraphVizItem::printAttribute().

bool otawa::display::GraphVizEdge::_hasLabel
protected

true if the label have been set, even if it is an empty string

Referenced by printAttribute(), and printOthersAttributes().

elm::genstruct::HashTable<const AbstractIdentifier*, int> otawa::display::GraphVizItem::_include
protectedinherited

List of properties to print.

If the key exists, include the property

Referenced by otawa::display::GraphVizItem::getPropertiesString(), and otawa::display::GraphVizItem::printAttribute().

String otawa::display::GraphVizEdge::_label
protected

label of the edge

Referenced by printAttribute(), and printOthersAttributes().

PropList otawa::display::GraphVizItem::_props
protectedinherited
GraphVizNode* otawa::display::GraphVizEdge::_src
protected

source of the edge

Referenced by source().

const PropList otawa::PropList::EMPTY
staticinherited

This is an empty proplist for convenience.


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