Otawa  0.10
otawa::display::Plugin Class Referenceabstract

A plugin to provide driver to display graphs. More...

#include <otawa/display/Plugin.h>

Inheritance diagram for otawa::display::Plugin:
otawa::ProcessorPlugin otawa::display::Driver otawa::display::GraphVizDriver

Public Member Functions

 Plugin (elm::CString name, const elm::Version &version, const elm::Version &plugger_version)
 Build the plugin. More...
 
 Plugin (void)
 
virtual elm::genstruct::Table
< AbstractRegistration * > & 
processors (void) const
 This method must return the table of all processor available in the plugin. More...
 
virtual GraphnewGraph (const PropList &defaultGraphStyle=PropList::EMPTY, const PropList &defaultNodeStyle=PropList::EMPTY, const PropList &defaultEdgeStyle=PropList::EMPTY) const =0
 Creates a new graph with default styles given. More...
 

Static Public Member Functions

static void addPath (const elm::system::Path &path)
 Add a path to the list of looked paths. More...
 
static void removePath (const elm::system::Path &path)
 Remove the given path from the looked path. More...
 
static ProcessorPluginget (string name)
 Find a plugin by its name. More...
 
static ProcessorgetProcessor (cstring name)
 Get a processor by its name, possibly loading required plugin. More...
 
static AbstractFeaturegetFeature (cstring name)
 Find a feature by its name, possibly loading a plugin. More...
 
static AbstractIdentifiergetIdentifier (cstring name)
 Find an identifier by its name possibly loading a plugin to get it. More...
 
static void setErrorHandler (ErrorHandler *error_handler)
 Set an error handler for the processor resolution plugger. More...
 
static ErrorHandlergetErrorHandler (void)
 Get the error handler of the processor resolution plugger. More...
 
static Driverfind (string name="")
 Find a driver by its name. More...
 
static Driverfind (kind_t kind)
 

Detailed Description

A plugin to provide driver to display graphs.

Constructor & Destructor Documentation

otawa::display::Plugin::Plugin ( elm::CString  name,
const elm::Version version,
const elm::Version plugger_version 
)

Build the plugin.

Parameters
nameName of the plugin.
versionVersion of the plugin.
plugger_versionVersion of the plugger (must be OTAWA_DISPLAY_VERSION).
otawa::display::Plugin::Plugin ( void  )
inline

Member Function Documentation

void otawa::ProcessorPlugin::addPath ( const elm::system::Path &  path)
staticinherited

Add a path to the list of looked paths.

Parameters
pathPath to add.

References otawa::ProcessorPlugin::init().

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

Driver * otawa::display::Driver::find ( string  name = "")
staticinherited

Find a driver by its name.

Parameters
nameName of the driver to look for.
Returns
Driver matching the name or the default driver if an empty string is passed.

References otawa::display::graphviz_driver.

Referenced by otawa::display::AbstractDrawer::AbstractDrawer().

static Driver* otawa::display::Driver::find ( kind_t  kind)
staticinherited
ProcessorPlugin * otawa::ProcessorPlugin::get ( string  name)
staticinherited

Find a plugin by its name.

The looked directories are, in order, "$PWD/.otawa/proc", "$HOME/.otawa/proc" or "$OTAWA_INSTALL_DIRECTORY/lib/otawa/proc". The full path name of the processor class must be passed in the name, something composed of "comp1::comp2::...::compn". First, a module whose path is by replacing in processor name "::" by "/" is looked. If not found, the last component of the path is removed and the obtained path is looked again for module. This process continue until the module is found or the path becomes empty resulting in a linkage failure.

Parameters
nameFull-qualified name of the processor.
Returns
Built processor or null if the processor cannot be found.

References _, otawa::ProcessorPlugin::init(), elm::String::lastIndexOf(), elm::level_error, elm::level_info, and elm::String::substring().

ErrorHandler * otawa::ProcessorPlugin::getErrorHandler ( void  )
staticinherited

Get the error handler of the processor resolution plugger.

Returns
Current error handler.

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

AbstractFeature * otawa::ProcessorPlugin::getFeature ( cstring  name)
staticinherited

Find a feature by its name, possibly loading a plugin.

Parameters
nameName of the looked feature.
Returns
Found feature or null.

References otawa::ProcessorPlugin::getIdentifier(), and otawa::IS_FEATURE.

Referenced by otawa::DynFeature::init().

AbstractIdentifier * otawa::ProcessorPlugin::getIdentifier ( cstring  name)
staticinherited

Find an identifier by its name possibly loading a plugin to get it.

Parameters
nameName of the identifier.
Returns
Found identifier or null.

References otawa::AbstractIdentifier::find().

Referenced by otawa::XSLTScript::fillProps(), otawa::ProcessorPlugin::getFeature(), otawa::DynIdentifier< T >::id(), otawa::script::Script::makeConfig(), and otawa::Application::run().

Processor * otawa::ProcessorPlugin::getProcessor ( cstring  name)
staticinherited

Get a processor by its name, possibly loading required plugin.

Parameters
nameName of the looked processor.
Returns
An instance of the processor or NULL if it cannot be found.

References otawa::Registry::find(), otawa::AbstractRegistration::make(), and name.

Referenced by otawa::DynProcessor::DynProcessor().

otawa::display::Driver::newGraph ( const PropList defaultGraphStyle = PropList::EMPTY,
const PropList defaultNodeStyle = PropList::EMPTY,
const PropList defaultEdgeStyle = PropList::EMPTY 
) const
pure virtualinherited

Creates a new graph with default styles given.

Parameters
defaultGraphStyledefault properties for the graph Can be changed with the methods inherited from PropList
defaultNodeStyledefault properties for the nodes Can be changed with the methods inherited from PropList
defaultEdgeStyledefault properties for the edges Can be changed with the methods inherited from PropList
Returns
new graph created

Implemented in otawa::display::GraphVizDriver.

Referenced by otawa::display::AbstractDrawer::AbstractDrawer(), and otawa::display::CFGDrawer::CFGDrawer().

elm::genstruct::Table< AbstractRegistration * > & otawa::ProcessorPlugin::processors ( void  ) const
virtualinherited

This method must return the table of all processor available in the plugin.

Returns
Table of available processors.

References elm::dtd::empty.

void otawa::ProcessorPlugin::removePath ( const elm::system::Path &  path)
staticinherited

Remove the given path from the looked path.

Parameters
pathPath to remove.

References otawa::ProcessorPlugin::init().

void otawa::ProcessorPlugin::setErrorHandler ( ErrorHandler error_handler)
staticinherited

Set an error handler for the processor resolution plugger.

Parameters
error_handlerNew error handler.

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


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