+/**
+ * Plugin is a base class designed to underpin any class whose implementation
+ * exists in a dynamically run-time loaded library.
+ * Plugin provides a foolproof check that you don't accidentally unload the
+ * library whose code you're still executing.
+ */
+class Plugin
+{
+public:
+ // Must never be inlined!
+ Plugin();
+ virtual ~Plugin() noexcept;
+
+ void keep_library_loaded(std::shared_ptr<void> const&);
+ std::shared_ptr<void> keep_library_loaded() const;
+private:
+ std::shared_ptr<void> library;
+};
This looks like an intrusive design to tackle the same problem addressed more elegantly by mir::make_module_ptr<>. Is there any reason we need both?
+/** loaded( std::shared_ ptr<void> const&); ptr<void> keep_library_ loaded( ) const; ptr<void> library;
+ * Plugin is a base class designed to underpin any class whose implementation
+ * exists in a dynamically run-time loaded library.
+ * Plugin provides a foolproof check that you don't accidentally unload the
+ * library whose code you're still executing.
+ */
+class Plugin
+{
+public:
+ // Must never be inlined!
+ Plugin();
+ virtual ~Plugin() noexcept;
+
+ void keep_library_
+ std::shared_
+private:
+ std::shared_
+};
This looks like an intrusive design to tackle the same problem addressed more elegantly by mir::make_ module_ ptr<>. Is there any reason we need both?