aboutsummaryrefslogtreecommitdiff
path: root/libs/plugin_python/src/mobase/deprecation.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/plugin_python/src/mobase/deprecation.h')
-rw-r--r--libs/plugin_python/src/mobase/deprecation.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/libs/plugin_python/src/mobase/deprecation.h b/libs/plugin_python/src/mobase/deprecation.h
new file mode 100644
index 0000000..d9a445c
--- /dev/null
+++ b/libs/plugin_python/src/mobase/deprecation.h
@@ -0,0 +1,27 @@
+#ifndef PYTHONRUNNER_UTILS_H
+#define PYTHONRUNNER_UTILS_H
+
+#include <string_view>
+
+#include <pybind11/pybind11.h>
+
+namespace mo2::python {
+
+ /**
+ * @brief Show a deprecation warning.
+ *
+ * This methods will print a warning in MO2 log containing the location of
+ * the call to the deprecated function. If show_once is true, the
+ * deprecation warning will only be logged the first time the function is
+ * called at this location.
+ *
+ * @param name Name of the deprecated function.
+ * @param message Deprecation message.
+ * @param show_once Only show the message once per call location.
+ */
+ void show_deprecation_warning(std::string_view name, std::string_view message = "",
+ bool show_once = true);
+
+} // namespace mo2::python
+
+#endif