Otawa  0.10
otawa::display::GraphVizItem Class Referenceabstract

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

Inheritance diagram for otawa::display::GraphVizItem:
otawa::display::GraphVizGraph otawa::display::GraphVizGraphElement otawa::display::GraphVizEdge otawa::display::GraphVizNode

Public Member Functions

 GraphVizItem ()
 Used to set the default behaviour of properties listing to "INCLUDE". More...
 
virtual ~GraphVizItem (void)
 
virtual void setProps (const PropList &props)
 
virtual String attributes ()=0
 calls attributes(const PropList& style) with the PropList containing the style of the item. More...
 

Protected Member Functions

virtual String getPropertiesString ()
 Makes a string containing the values of all properties in _props separated by newlines. More...
 
virtual void printOthersAttributes (elm::io::Output &out)
 Prints attributes after all the style PropList have been iterated. 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

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 is the superclass of all graphviz elements (Node, Edge & Graph)

Constructor & Destructor Documentation

otawa::display::GraphVizItem::GraphVizItem ( )

Used to set the default behaviour of properties listing to "INCLUDE".

virtual otawa::display::GraphVizItem::~GraphVizItem ( void  )
inlinevirtual

Member Function Documentation

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

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(), printAttribute(), printOthersAttributes(), otawa::display::quoteNewlines(), and elm::StringBuffer::toString().

otawa::display::GraphVizItem::attributes ( void  )
pure virtual
String otawa::display::GraphVizItem::getPropertiesString ( )
protectedvirtual

Makes a string containing the values of all properties in _props separated by newlines.

Returns
string containing properties values

References _defaultInclude, _exclude, _include, _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().

bool otawa::display::GraphVizItem::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 in otawa::display::GraphVizEdge, otawa::display::GraphVizNode, and otawa::display::GraphVizGraphElement.

References _defaultInclude, _exclude, _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 attributes(), and otawa::display::GraphVizGraphElement::printAttribute().

void otawa::display::GraphVizItem::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 in otawa::display::GraphVizGraph, otawa::display::GraphVizEdge, and otawa::display::GraphVizNode.

Referenced by attributes().

Member Data Documentation

bool otawa::display::GraphVizItem::_defaultInclude
protected

true if the default is to include all properties

Referenced by getPropertiesString(), and printAttribute().

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

List of properties to hide.

If the key exists, exclude the property

Referenced by getPropertiesString(), and printAttribute().

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

List of properties to print.

If the key exists, include the property

Referenced by getPropertiesString(), and printAttribute().

PropList otawa::display::GraphVizItem::_props
protected

Properties of the attached object.

Referenced by getPropertiesString(), and setProps().


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