Otawa  0.10
Loader.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * Copyright (c) 2003, IRIT UPS.
4  *
5  * otawa/prog/Loader.h -- interface for Loader class.
6  */
7 #ifndef OTAWA_PROG_LOADER_H
8 #define OTAWA_PROG_LOADER_H
9 
10 #include <elm/system/Plugin.h>
11 #include <otawa/base.h>
12 #include <otawa/properties.h>
13 #include <otawa/prog/Process.h>
14 #include <otawa/hard/Platform.h>
15 
16 
17 namespace otawa {
18 
19 namespace sim {
20  class Simulator;
21 }
22 
23 
24 // Useful defines
25 #define OTAWA_LOADER_VERSION "2.0.0"
26 #define OTAWA_LOADER_HOOK loader_plugin
27 #define OTAWA_LOADER_NAME "loader_plugin"
28 #define OTAWA_LOADER_ID(name, version, date) ELM_PLUGIN_ID(OTAWA_LOADER_NAME, name " V" version " (" date ") [" OTAWA_LOADER_VERSION "]")
29 
30 // Loader class
31 class Loader: public elm::system::Plugin {
32  friend class Manager;
33 protected:
34  virtual ~Loader(void) { };
35 public:
36  Loader(CString name, Version version, Version plugger_version,
37  const elm::system::Plugin::aliases_t & aliases
38  = elm::system::Plugin::aliases_t::EMPTY);
39 
40  virtual CString getName(void) const = 0;
41  virtual Process *load(Manager *man, CString path, const PropList& props) = 0;
42  virtual Process *create(Manager *man, const PropList& props) = 0;
43 
44  void check(WorkSpace *ws, cstring name, const Version& version);
45 
46 };
47 
48 } // otawa
49 
50 #endif // OTAWA_PROG_LOADER_H
void check(WorkSpace *ws, cstring name, const Version &version)
Check the loader used in the given workspace matches the given name and version.
Definition: Loader.cpp:101
virtual Process * create(Manager *man, const PropList &props)=0
Build a new empty process matching the given properties.
This class represents a plugin to use facilities provided by a simulator.
Definition: Simulator.h:36
The manager class providesfacilities for storing, grouping and retrieving shared resources like loade...
Definition: Manager.h:58
Loader(CString name, Version version, Version plugger_version, const elm::system::Plugin::aliases_t &aliases=elm::system::Plugin::aliases_t::EMPTY)
virtual Process * load(Manager *man, CString path, const PropList &props)=0
Load the file matching the given path with the given properties.
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
A process is the realization of a program on a platform.
Definition: Process.h:136
virtual ~Loader(void)
Virtual destructor for destruction customization.
Definition: Loader.h:34
This interface is implemented by all objects that may build and provide a process.
Definition: Loader.h:31
cstring name
Definition: odisasm.cpp:107
This a list of properties.
Definition: PropList.h:63
virtual CString getName(void) const =0
Get the name of the loader.