summaryrefslogtreecommitdiff
path: root/libadhocutil/plugins.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-09-18 02:35:30 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-09-18 02:35:30 +0100
commitb99a435f52de826327ea3e4cc8cc8aaf348d5b53 (patch)
tree90fd3bf144108aa0a9d27856b3f5eb65ab6d0020 /libadhocutil/plugins.h
parentSupport addition and removal of plugin resolver functions (diff)
downloadlibadhocutil-b99a435f52de826327ea3e4cc8cc8aaf348d5b53.tar.bz2
libadhocutil-b99a435f52de826327ea3e4cc8cc8aaf348d5b53.tar.xz
libadhocutil-b99a435f52de826327ea3e4cc8cc8aaf348d5b53.zip
Use resolvers to load libraries automagically on demand
Diffstat (limited to 'libadhocutil/plugins.h')
-rw-r--r--libadhocutil/plugins.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libadhocutil/plugins.h b/libadhocutil/plugins.h
index 8b8efac..03d59fb 100644
--- a/libadhocutil/plugins.h
+++ b/libadhocutil/plugins.h
@@ -63,6 +63,13 @@ namespace AdHoc {
DuplicateResolverException(const std::type_info &);
};
+ /// Thrown when an attempt to load a library fails.
+ class LoadLibraryException : public std::runtime_error {
+ public:
+ /// Constuctor taking syscall error details.
+ LoadLibraryException(const std::string & f, const char * msg);
+ };
+
template <typename T>
/// Typed plugin and handle to implementation.
class DLL_PUBLIC PluginOf : public Plugin {
@@ -171,6 +178,8 @@ namespace AdHoc {
static PluginManager * getDefault();
private:
+ static void loadLibrary(const std::string &);
+
typedef boost::multi_index_container<PluginPtr,
boost::multi_index::indexed_by<
boost::multi_index::ordered_non_unique<boost::multi_index::member<Plugin, const std::string, &Plugin::name>>,