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>
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 \
--- /dev/null
+/*
+ * 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 */
+++ /dev/null
-/*
- * 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 */
#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"