Otawa  0.10
ProcessorPlugin.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * ProcessorPlugin class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2009, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef OTAWA_PROC_PROCESSORPLUGIN_H_
23 #define OTAWA_PROC_PROCESSORPLUGIN_H_
24 
25 #include <elm/genstruct/Table.h>
26 #include <elm/system/Plugin.h>
27 #include <elm/system/Path.h>
29 #include <elm/util/ErrorHandler.h>
30 
31 namespace otawa {
32 
33 // Definitions
34 #define OTAWA_PROC_HOOK proc_plugin
35 #define OTAWA_PROC_NAME "proc_plugin"
36 #define OTAWA_PROC_VERSION "1.0.0"
37 #define OTAWA_PROC_ID(name, version, date) ELM_PLUGIN_ID(OTAWA_PROC_NAME, name " V" version " (" date ") [" OTAWA_PROC_VERSION "]")
38 
39 // ProcessorPlugin class
40 class ProcessorPlugin: public elm::system::Plugin {
41 public:
42  ProcessorPlugin(cstring name, const elm::Version& version, const elm::Version& plugger_version);
43  ~ProcessorPlugin(void);
45 
46  static void addPath(const elm::system::Path& path);
47  static void removePath(const elm::system::Path& path);
48  static ProcessorPlugin *get(string name);
49  static Processor *getProcessor(cstring name);
50  static AbstractFeature *getFeature(cstring name);
52  static void setErrorHandler (ErrorHandler *error_handler);
53  static ErrorHandler *getErrorHandler(void);
54 
55 private:
56  static void init(void);
57 };
58 
59 } // otawa
60 
61 #endif /* OTAWA_PROC_PROCESSORPLUGIN_H_ */
62 
static void addPath(const elm::system::Path &path)
Add a path to the list of looked paths.
Definition: proc_ProcessorPlugin.cpp:168
static AbstractIdentifier * getIdentifier(cstring name)
Find an identifier by its name possibly loading a plugin to get it.
Definition: proc_ProcessorPlugin.cpp:227
ProcessorPlugin(cstring name, const elm::Version &version, const elm::Version &plugger_version)
Build a new processor plugin.
Definition: proc_ProcessorPlugin.cpp:84
static AbstractFeature * getFeature(cstring name)
Find a feature by its name, possibly loading a plugin.
Definition: proc_ProcessorPlugin.cpp:210
static void init(void)
Initialize the plugger.
Definition: proc_ProcessorPlugin.cpp:114
Represents a unique identifier used by the annotation system.
Definition: AbstractIdentifier.h:32
static Processor * getProcessor(cstring name)
Get a processor by its name, possibly loading required plugin.
Definition: proc_ProcessorPlugin.cpp:191
static void removePath(const elm::system::Path &path)
Remove the given path from the looked path.
Definition: proc_ProcessorPlugin.cpp:179
The processor class is implemented by all code processor.
Definition: Processor.h:49
This class must implemented by plugins containing processor, features and identifiers.
Definition: ProcessorPlugin.h:40
static ErrorHandler * getErrorHandler(void)
Get the error handler of the processor resolution plugger.
Definition: proc_ProcessorPlugin.cpp:248
virtual elm::genstruct::Table< AbstractRegistration * > & processors(void) const
This method must return the table of all processor available in the plugin.
Definition: proc_ProcessorPlugin.cpp:104
cstring name
Definition: odisasm.cpp:107
~ProcessorPlugin(void)
Definition: proc_ProcessorPlugin.cpp:95
See Feature.
Definition: AbstractFeature.h:36
static void setErrorHandler(ErrorHandler *error_handler)
Set an error handler for the processor resolution plugger.
Definition: proc_ProcessorPlugin.cpp:239