#ifndef modules_h #define modules_h #include #include "exceptions.h" #include #include namespace eir { class ModuleRegistry : public paludis::InstantiationPolicy, public paludis::PrivateImplementationPattern { public: void load(std::string) throw(ModuleError); bool unload(std::string); bool is_loaded(std::string); ModuleRegistry(); ~ModuleRegistry(); }; // A module's create() function should return a pointer to one of these. It will be destroyed // before unloading the module. class Module { public: virtual ~Module() = 0; }; } // Utility macro to save typing in module source files #define MODULE_CLASS(x) extern "C" Module *create() { return new x;} #endif