Mir

Code review comment for lp:~vanvugt/mir/fix-1527449

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

+/**
+ * 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?

review: Needs Information

« Back to merge proposal