]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
metaplugin: Add function to determine if the plugin is ready to be used
authorEric Bollengier <eric@baculasystems.com>
Fri, 25 Feb 2022 15:02:07 +0000 (16:02 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:28 +0000 (09:03 +0100)
bacula/src/plugins/fd/pluginlib/commctx.h

index fecef7d5733617e0db202eec76210076b2bd5203..f7fdc564211e5141cd537475cd184e0476edb702 100644 (file)
@@ -69,7 +69,12 @@ public:
    bool check_command(const char *command);
    void foreach_command(void (*func)(T *, void *), void *param);
    bRC foreach_command_status(bRC (*func)(T *, void *), void *param);
+   bool is_ctx_null() { return ctx == NULL ; }
 
+   /* Shortcut that will blow up if ctx is not yet defined, use carefully
+    * The gdb backtrace is misleading, we see pluginctx->xxx while we
+    * do pluginctx.ctx->xxx
+    */
    T * operator->() { return ctx; }
 };