Otawa
0.10
|
A class making easier the use of applications built on OTAWA. More...
#include <otawa/app/Application.h>
Public Types | |
typedef const char *const * | argv_t |
Public Member Functions | |
Application (cstring _program, Version _version=Version::ZERO, cstring _description="", cstring _author="", cstring _copyright="") | |
Build the application. More... | |
virtual | ~Application (void) |
int | run (int argc, char **argv) |
Run the application: More... | |
void | addOption (Option *option) |
void | removeOption (Option *option) |
void | parse (int argc, argv_t argv) |
void | displayHelp (void) |
cstring | getProgram (void) const |
const Version & | getVersion (void) const |
cstring | getAuthor (void) const |
cstring | getCopyright (void) const |
cstring | getDescription (void) const |
cstring | getFreeArgumentDescription (void) const |
Protected Member Functions | |
virtual void | prepare (PropList &props) |
This method may be overriden by the child class in order to customize the building of configuration property list. More... | |
virtual void | work (PropList &props) throw (elm::Exception) |
This method must be overriden to implement the action of the application. More... | |
virtual void | work (const string &entry, PropList &props) throw (elm::Exception) |
This method must be overriden to give a special behaviour for each free argument of the command line (supposed to be the tasks entry points). More... | |
WorkSpace * | workspace (void) const |
Provide the current workspace. More... | |
void | require (const AbstractFeature &feature) |
Perform a require request on the current process with the current configuration property list (as configured in prepare()). More... | |
virtual void | process (string arg) |
If overriden, this method allows to provide a customized behaviour to the usual processing of free arguments. More... | |
bool | isVerbose (void) const |
const genstruct::Vector< string > | arguments (void) const |
Address | parseAddress (const string &s) throw (otawa::Exception) |
Parse a symbolic address and return it. More... | |
virtual void | configure (int tag, VarArg &args) |
Protected Attributes | |
Make | info |
Private Attributes | |
option::BoolOption | help |
option::BoolOption | verbose |
option::ListOption< string > | sets |
option::ListOption< string > | params |
option::ListOption< string > | ff |
LogOption | log_level |
elm::system::Path | path |
genstruct::Vector< string > | _args |
PropList | props |
PropList * | props2 |
int | result |
WorkSpace * | ws |
A class making easier the use of applications built on OTAWA.
It automatically support for
Usually
, it specialized according your application purpose:
otawa::Application::Application | ( | cstring | _program, |
Version | _version = Version::ZERO , |
||
cstring | _description = "" , |
||
cstring | _author = "" , |
||
cstring | _copyright = "" |
||
) |
Build the application.
_program | Program name. |
_version | Current version (optional). |
_description | Description of the application (optional). |
_author | Author identification. |
_copyright | Applied copyright. |
|
virtual |
|
inlineprotected |
|
inlineprotected |
References verbose.
|
protected |
Parse a symbolic address and return it.
s | Address string to parse. |
otawa::Exception | If the address cannot be resolved or parsed. |
References _, otawa::SymAddress::parse(), and otawa::SymAddress::toAddress().
|
protectedvirtual |
|
protectedvirtual |
If overriden, this method allows to provide a customized behaviour to the usual processing of free arguments.
arg | Current argument. |
Reimplemented from elm::option::Manager.
|
protected |
Perform a require request on the current process with the current configuration property list (as configured in prepare()).
feature | Feature to require. |
References props2, otawa::WorkSpace::require(), and ws.
int otawa::Application::run | ( | int | argc, |
char ** | argv | ||
) |
Run the application:
References _args, cerr, elm::option::ListOption< class >::count(), elm::option::Manager::displayHelp(), ff, otawa::AbstractIdentifier::find(), otawa::FLOW_FACTS_PATH, otawa::ProcessorPlugin::getIdentifier(), help, elm::String::indexOf(), otawa::Manager::load(), otawa::LOAD_PARAM, log_level, otawa::Processor::LOG_LEVEL, otawa::MANAGER, elm::MessageException::message(), elm::Exception::message(), name, params, elm::option::Manager::parse(), path, prepare(), props, result, sets, elm::String::substring(), verbose, otawa::Processor::VERBOSE, work(), and ws.
|
protectedvirtual |
This method must be overriden to implement the action of the application.
As a default, it call the work(string, props) method for each free argument on a command line (supposed to be a task entry).
When this method is called, the program has been already loaded.
elm::Exception | For any found error. |
References otawa::TASK_ADDRESS.
Referenced by run().
|
protectedvirtual |
This method must be overriden to give a special behaviour for each free argument of the command line (supposed to be the tasks entry points).
As a default, do nothing.
When this method is called, the program has already been loaded and the workspace is marked as having as entry point the one passed in argument: threfore the workspace is ready for computation.
entry | Task entry point name or any free argument. |
elm::Exception | For any found error. |
|
inlineprotected |
Provide the current workspace.
|
private |
|
private |
Referenced by run().
|
private |
Referenced by run().
|
private |
Referenced by run().
|
private |
Referenced by run().
|
private |
Referenced by run().
|
private |
Referenced by run().