summaryrefslogtreecommitdiffhomepage
path: root/api/plugin-api.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'api/plugin-api.hpp')
-rw-r--r--api/plugin-api.hpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/api/plugin-api.hpp b/api/plugin-api.hpp
index 52776986..3fd605b2 100644
--- a/api/plugin-api.hpp
+++ b/api/plugin-api.hpp
@@ -21,10 +21,15 @@
using Pose = Mat<double, 6, 1>;
-enum Axis {
- TX, TY, TZ, Yaw, Pitch, Roll,
-
+enum Axis : int
+{
NonAxis = -1,
+ TX = 0, TY = 1, TZ = 2,
+
+ Yaw = 3, Pitch = 4, Roll = 5,
+ Axis_MIN = TX, Axis_MAX = 5,
+
+ Axis_COUNT = 6,
};
namespace plugin_api::detail {
@@ -84,7 +89,7 @@ class OTR_API_EXPORT Metadata : public TR, public Metadata_
public:
Metadata();
- ~Metadata();
+ ~Metadata() override;
};
struct OTR_API_EXPORT module_status final
@@ -92,7 +97,8 @@ struct OTR_API_EXPORT module_status final
QString error;
bool is_ok() const;
- module_status(QString error = {});
+ module_status();
+ explicit module_status(const QString& error);
};
/*
@@ -104,6 +110,7 @@ struct OTR_API_EXPORT module_status_mixin
static module_status error(const QString& error); // return error message on init failure
virtual module_status initialize() = 0; // where to return from
+ virtual ~module_status_mixin();
};
// implement this in filters
@@ -114,7 +121,7 @@ struct OTR_API_EXPORT IFilter : module_status_mixin
IFilter();
// optional destructor
- virtual ~IFilter();
+ ~IFilter() override;
// perform filtering step.
// you have to take care of dt on your own, try "opentrack-compat/timer.hpp"
virtual void filter(const double *input, double *output) = 0;
@@ -125,6 +132,7 @@ struct OTR_API_EXPORT IFilter : module_status_mixin
struct OTR_API_EXPORT IFilterDialog : public plugin_api::detail::BaseDialog
{
IFilterDialog();
+ ~IFilterDialog() override;
// optional destructor
//~IFilterDialog() override;
@@ -142,12 +150,11 @@ struct OTR_API_EXPORT IFilterDialog : public plugin_api::detail::BaseDialog
struct OTR_API_EXPORT IProtocol : module_status_mixin
{
IProtocol();
+ ~IProtocol() override;
IProtocol(const IProtocol&) = delete;
IProtocol& operator=(const IProtocol&) = delete;
- // optional destructor
- virtual ~IProtocol();
// called 250 times a second with XYZ yaw pitch roll pose
// try not to perform intense computation here. use a thread.
virtual void pose(const double* headpose) = 0;
@@ -165,6 +172,7 @@ struct OTR_API_EXPORT IProtocolDialog : public plugin_api::detail::BaseDialog
virtual void unregister_protocol() = 0;
IProtocolDialog();
+ ~IProtocolDialog() override;
};
// call once with your chosen class names in the plugin
@@ -203,6 +211,7 @@ struct OTR_API_EXPORT ITrackerDialog : public plugin_api::detail::BaseDialog
virtual void unregister_tracker();
ITrackerDialog();
+ ~ITrackerDialog() override;
};
// call once with your chosen class names in the plugin
@@ -231,7 +240,7 @@ struct OTR_API_EXPORT IExtension : module_status_mixin
};
IExtension() = default;
- virtual ~IExtension();
+ ~IExtension() override;
virtual event_mask hook_types() = 0;