Otawa  0.10
otawa::display::GraphVizNode Class Reference

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

Inheritance diagram for otawa::display::GraphVizNode:
otawa::display::Node otawa::display::GraphVizGraphElement otawa::display::Item otawa::display::GraphVizItem otawa::PropList

Public Member Functions

 GraphVizNode (int number)
 Creates a new node with the given number. More...
 
virtual int number ()
 This function returns the number of this node. 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

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...
 

Private Attributes

String _title
 node title More...
 
bool _hasTitle
 true if the title have been set, even if it is an empty string More...
 
String _body
 node body More...
 
bool _hasBody
 true if the body have been set, even if it is an empty string More...
 
bool _shapeAcceptsBody
 true if the shape selected can be cutted into sub-boxes More...
 
int _number
 number of the node More...
 

Detailed Description

Author
G. Cavaignac

This class represents the nodes in the graphviz graph

Constructor & Destructor Documentation

otawa::display::GraphVizNode::GraphVizNode ( int  number)

Creates a new node with the given number.

One must give a different number each time, or the nodes could be confused in the graph

Parameters
numbernode number

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::GraphVizNode::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().

otawa::display::GraphVizNode::number ( void  )
inlinevirtual

This function returns the number of this node.

Returns
number of this node

References _number.

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

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::GraphVizNode::printAttribute ( elm::io::Output out,
const PropList::Iter prop 
)
protectedvirtual
void otawa::display::GraphVizNode::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 _body, _hasBody, _hasTitle, _shapeAcceptsBody, _title, 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::GraphVizNode::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::newNode().

Member Data Documentation

String otawa::display::GraphVizNode::_body
private

node body

Referenced by printAttribute(), and printOthersAttributes().

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

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::GraphVizNode::_hasBody
private

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

Referenced by printAttribute(), and printOthersAttributes().

bool otawa::display::GraphVizNode::_hasTitle
private

true if the title 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().

int otawa::display::GraphVizNode::_number
private

number of the node

Referenced by number().

PropList otawa::display::GraphVizItem::_props
protectedinherited
bool otawa::display::GraphVizNode::_shapeAcceptsBody
private

true if the shape selected can be cutted into sub-boxes

Referenced by printAttribute(), and printOthersAttributes().

String otawa::display::GraphVizNode::_title
private

node title

Referenced by printAttribute(), and printOthersAttributes().

const PropList otawa::PropList::EMPTY
staticinherited

This is an empty proplist for convenience.


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