Otawa
0.10
|
As some identifier, feature and processors are located in plug-ins, they can be retrieved at linking time. More...
Classes | |
class | otawa::DynFeature |
This class is used to resolve feature found in plugins using ProcessorPlugin::getFeature() method. More... | |
class | otawa::DynIdentifier< T > |
An identifier dynamically resolved. More... | |
class | otawa::ProcessorNotFound |
This exception is thrown when a code processor can not be found. More... | |
Functions | |
otawa::DynProcessor::DynProcessor (cstring name) throw (ProcessorNotFound) | |
Find the processor whose name is given. More... | |
As some identifier, feature and processors are located in plug-ins, they can be retrieved at linking time.
To use them, one has to load automatically the matching plug-in and then to access the required object.
This achieved automatically using the three classes:
These classes works as proxies using the symbolic name of the looked object. If not already resolved, they try tore load the plug-in from the name of object (must be full qualified C++ name) and look the matching actual object.
The example below show the use of these classes. First, we have an header file provided by the plugin: MyPlugin.h.
The MyPlugin.cpp file declare the feature and the identifier as usual:
The user application includes the header file, uses the macro definition and use identifiers as usual.
otawa::DynProcessor::DynProcessor | ( | cstring | name | ) | |
throw | ( | ProcessorNotFound | |||
) |
Find the processor whose name is given.
name | Name of the processor. |
ProcessorNotFound | If the processor can not be found. |
References otawa::ProcessorPlugin::getProcessor(), name, and proc.