cpp-common/bt2: move findAllPluginsFromDir() to `plugin-load.hpp`
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 19 Feb 2024 18:20:44 +0000 (13:20 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 29 Feb 2024 23:46:23 +0000 (18:46 -0500)
All "find plugin(s)" function will go in that file.

Change-Id: Ie81a35d8a253dafef2fd696c64341609b0e4960b
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11821
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/Makefile.am
src/cpp-common/bt2/plugin-load.hpp [new file with mode: 0644]
src/cpp-common/bt2/plugin.hpp [deleted file]
tests/lib/test-plugin-init-fail.cpp

index 873ccf8560a32058f3243393e294c3d6106b6232..235dab4eb729d1f9d3f8aaae17e1301d9c50b815 100644 (file)
@@ -135,8 +135,8 @@ cpp_common_libcpp_common_la_SOURCES = \
        cpp-common/bt2/message.hpp \
        cpp-common/bt2/optional-borrowed-object.hpp \
        cpp-common/bt2/plugin-dev.hpp \
+       cpp-common/bt2/plugin-load.hpp \
        cpp-common/bt2/plugin-set.hpp \
-       cpp-common/bt2/plugin.hpp \
        cpp-common/bt2/private-query-executor.hpp \
        cpp-common/bt2/query-executor.hpp \
        cpp-common/bt2/raw-value-proxy.hpp \
diff --git a/src/cpp-common/bt2/plugin-load.hpp b/src/cpp-common/bt2/plugin-load.hpp
new file mode 100644 (file)
index 0000000..0f3e8d5
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2024 EfficiOS, Inc.
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef BABELTRACE_CPP_COMMON_BT2_PLUGIN_LOAD_HPP
+#define BABELTRACE_CPP_COMMON_BT2_PLUGIN_LOAD_HPP
+
+#include <babeltrace2/babeltrace.h>
+
+#include "common/common.h"
+#include "cpp-common/bt2c/c-string-view.hpp"
+
+#include "exc.hpp"
+#include "plugin-set.hpp"
+
+namespace bt2 {
+
+inline ConstPluginSet::Shared findAllPluginsFromDir(const bt2c::CStringView path,
+                                                    const bool recurse, const bool failOnLoadError)
+{
+    const bt_plugin_set *pluginSet;
+
+    switch (bt_plugin_find_all_from_dir(path, recurse, failOnLoadError, &pluginSet)) {
+    case BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_OK:
+        return ConstPluginSet::Shared::createWithoutRef(pluginSet);
+    case BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_NOT_FOUND:
+        return ConstPluginSet::Shared {};
+    case BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_MEMORY_ERROR:
+        throw MemoryError {};
+    case BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_ERROR:
+        throw Error {};
+    }
+
+    bt_common_abort();
+}
+
+} /* namespace bt2 */
+
+#endif /* BABELTRACE_CPP_COMMON_BT2_PLUGIN_LOAD_HPP */
diff --git a/src/cpp-common/bt2/plugin.hpp b/src/cpp-common/bt2/plugin.hpp
deleted file mode 100644 (file)
index 6d1a71a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2024 EfficiOS, Inc.
- *
- * SPDX-License-Identifier: MIT
- */
-
-#ifndef BABELTRACE_CPP_COMMON_BT2_PLUGIN_HPP
-#define BABELTRACE_CPP_COMMON_BT2_PLUGIN_HPP
-
-#include <babeltrace2/babeltrace.h>
-
-#include "common/common.h"
-#include "cpp-common/bt2c/c-string-view.hpp"
-
-#include "exc.hpp"
-#include "plugin-set.hpp"
-
-namespace bt2 {
-
-inline ConstPluginSet::Shared findAllPluginsFromDir(const bt2c::CStringView path,
-                                                    const bool recurse, const bool failOnLoadError)
-{
-    const bt_plugin_set *pluginSet;
-
-    switch (bt_plugin_find_all_from_dir(path, recurse, failOnLoadError, &pluginSet)) {
-    case BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_OK:
-        return ConstPluginSet::Shared::createWithoutRef(pluginSet);
-    case BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_NOT_FOUND:
-        return ConstPluginSet::Shared {};
-    case BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_MEMORY_ERROR:
-        throw MemoryError {};
-    case BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_ERROR:
-        throw Error {};
-    }
-
-    bt_common_abort();
-}
-
-} /* namespace bt2 */
-
-#endif /* BABELTRACE_CPP_COMMON_BT2_PLUGIN_HPP */
index 8a0fde626734f76ac7bb620b28237b9ff4f928d5..6aac20d0c32d5bf60a40de051d931b52100202e2 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "common/common.h"
 #include "cpp-common/bt2/exc.hpp"
-#include "cpp-common/bt2/plugin.hpp"
+#include "cpp-common/bt2/plugin-load.hpp"
 #include "cpp-common/bt2c/c-string-view.hpp"
 #include "cpp-common/vendor/fmt/core.h"
 
This page took 0.0275339999999999 seconds and 4 git commands to generate.