Otawa
0.10
|
This class must implemented by plugins containing processor, features and identifiers. More...
#include <otawa/proc/ProcessorPlugin.h>
Public Member Functions | |
ProcessorPlugin (cstring name, const elm::Version &version, const elm::Version &plugger_version) | |
Build a new processor plugin. More... | |
~ProcessorPlugin (void) | |
virtual elm::genstruct::Table < AbstractRegistration * > & | processors (void) const |
This method must return the table of all processor available in the plugin. 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 ProcessorPlugin * | get (string name) |
Find a plugin by its name. More... | |
static Processor * | getProcessor (cstring name) |
Get a processor by its name, possibly loading required plugin. More... | |
static AbstractFeature * | getFeature (cstring name) |
Find a feature by its name, possibly loading a plugin. More... | |
static AbstractIdentifier * | getIdentifier (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 ErrorHandler * | getErrorHandler (void) |
Get the error handler of the processor resolution plugger. More... | |
Static Private Member Functions | |
static void | init (void) |
Initialize the plugger. More... | |
This class must implemented by plugins containing processor, features and identifiers.
otawa::ProcessorPlugin::ProcessorPlugin | ( | cstring | name, |
const elm::Version & | version, | ||
const elm::Version & | plugger_version | ||
) |
Build a new processor plugin.
name | Name of the plugin (may be full-qualified C++ name with "::" or canonical name with "/"). |
version | Version of the plugin. |
plugger_version | Version for the plugger interface (OTAWA_PROC_VERSION). |
otawa::ProcessorPlugin::~ProcessorPlugin | ( | void | ) |
|
static |
Add a path to the list of looked paths.
path | Path to add. |
References init().
Referenced by otawa::script::Script::work().
|
static |
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.
name | Full-qualified name of the processor. |
References _, init(), elm::String::lastIndexOf(), elm::level_error, elm::level_info, and elm::String::substring().
|
static |
Get the error handler of the processor resolution plugger.
Referenced by otawa::script::Script::processWorkSpace().
|
static |
Find a feature by its name, possibly loading a plugin.
name | Name of the looked feature. |
References getIdentifier(), and otawa::IS_FEATURE.
Referenced by otawa::DynFeature::init().
|
static |
Find an identifier by its name possibly loading a plugin to get it.
name | Name of the identifier. |
References otawa::AbstractIdentifier::find().
Referenced by otawa::XSLTScript::fillProps(), getFeature(), otawa::DynIdentifier< T >::id(), otawa::script::Script::makeConfig(), and otawa::Application::run().
Get a processor by its name, possibly loading required plugin.
name | Name of the looked processor. |
References otawa::Registry::find(), otawa::AbstractRegistration::make(), and name.
Referenced by otawa::DynProcessor::DynProcessor().
|
staticprivate |
Initialize the plugger.
References CSTR, otawa::MANAGER, and otawa::Manager::prefixPath().
Referenced by addPath(), get(), and removePath().
|
virtual |
This method must return the table of all processor available in the plugin.
References elm::dtd::empty.
|
static |
|
static |
Set an error handler for the processor resolution plugger.
error_handler | New error handler. |
Referenced by otawa::script::Script::processWorkSpace().