loader.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __PLUGIN_LOADER_H_
00025 #define __PLUGIN_LOADER_H_
00026
00027 #include <core/plugin.h>
00028 #include <core/exception.h>
00029
00030 #include <string>
00031
00032 namespace fawkes {
00033 #if 0
00034 }
00035 #endif
00036
00037 class Module;
00038 class Configuration;
00039 class PluginLoaderData;
00040
00041 class PluginLoadException : public Exception
00042 {
00043 public:
00044 PluginLoadException(const char *plugin, const char *message);
00045 PluginLoadException(const char *plugin, const char *message, Exception &e);
00046 };
00047
00048 class PluginUnloadException : public Exception
00049 {
00050 public:
00051 PluginUnloadException(const char *plugin_type, const char *add_msg = NULL);
00052 };
00053
00054
00055 class PluginLoader {
00056 public:
00057
00058 PluginLoader(const char *plugin_base_dir, Configuration *config);
00059 ~PluginLoader();
00060
00061 Plugin * load(const char *plugin_name);
00062 void unload(Plugin *plugin);
00063
00064 std::string get_description(const char *plugin_name);
00065
00066 bool is_loaded(const char *plugin_name);
00067
00068 private:
00069 Module * open_module(const char *plugin_name);
00070 Plugin * create_instance(const char *plugin_name, Module *module);
00071
00072 private:
00073 PluginLoaderData *d;
00074 Configuration *__config;
00075 };
00076
00077
00078 }
00079
00080 #endif