24 #ifndef __CORE_PLUGIN_H_ 25 #define __CORE_PLUGIN_H_ 27 #include <core/threading/thread_list.h> 40 const char *
name()
const;
82 typedef const char * (* PluginDescriptionFunc) ();
88 typedef const char * (* PluginDependenciesFunc) ();
94 #define PLUGIN_FACTORY(plugin_class) \ 97 plugin_factory(fawkes::Configuration *config) \ 99 return new plugin_class(config); \ 107 #define PLUGIN_DESTROY(plugin_class) \ 110 plugin_destroy(plugin_class *plugin) \ 120 #define PLUGIN_DESCRIPTION(info_string) \ 121 extern "C" const char _plugin_description[] \ 122 __attribute((__section__(".fawkes_plugin"))) \ 123 __attribute((__used__)) = info_string; \ 127 plugin_description() \ 129 return _plugin_description; \ 138 #define PLUGIN_DEPENDS(plugin_list) \ 139 extern "C" const char _plugin_dependencies[] \ 140 __attribute((__section__(".fawkes_plugin"))) \ 141 __attribute((__used__)) = info_string; \ 147 return _plugin_dependencies; \ 155 #define EXPORT_PLUGIN(plugin_class) \ 156 PLUGIN_FACTORY(plugin_class) \ 158 PLUGIN_DESTROY(plugin_class)
void set_name(const char *name)
Set plugin name.
Fawkes library namespace.
void(* PluginDestroyFunc)(Plugin *plugin)
Plugin destructor function for the shared library.
ThreadList & threads()
Get a list of threads.
const char * name() const
Get the name of the plugin.
ThreadList thread_list
Thread list member.
Plugin(Configuration *config)
Constructor.
Configuration * config
Fawkes configuration.
virtual ~Plugin()
Virtual destructor.
Interface for configuration handling.
virtual bool persistent()
Determines if the plugin can be unloaded.