From f785f73e9279dcb9cfdee93da694d7a1f55142ea Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 2 Feb 2022 12:59:36 -0500 Subject: general: Replace NonCopyable struct with equivalents --- src/common/telemetry.h | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src/common/telemetry.h') diff --git a/src/common/telemetry.h b/src/common/telemetry.h index 49186e848..d38aeac99 100644 --- a/src/common/telemetry.h +++ b/src/common/telemetry.h @@ -8,6 +8,7 @@ #include #include #include +#include "common/common_funcs.h" #include "common/common_types.h" namespace Common::Telemetry { @@ -28,7 +29,7 @@ struct VisitorInterface; /** * Interface class for telemetry data fields. */ -class FieldInterface : NonCopyable { +class FieldInterface { public: virtual ~FieldInterface() = default; @@ -52,14 +53,15 @@ public: template class Field : public FieldInterface { public: + YUZU_NON_COPYABLE(Field); + Field(FieldType type_, std::string name_, T value_) : name(std::move(name_)), type(type_), value(std::move(value_)) {} - Field(const Field&) = default; - Field& operator=(const Field&) = default; + ~Field() override = default; - Field(Field&&) = default; - Field& operator=(Field&& other) = default; + Field(Field&&) noexcept = default; + Field& operator=(Field&& other) noexcept = default; void Accept(VisitorInterface& visitor) const override; @@ -98,9 +100,15 @@ private: /** * Collection of data fields that have been logged. */ -class FieldCollection final : NonCopyable { +class FieldCollection final { public: + YUZU_NON_COPYABLE(FieldCollection); + FieldCollection() = default; + ~FieldCollection() = default; + + FieldCollection(FieldCollection&&) noexcept = default; + FieldCollection& operator=(FieldCollection&&) noexcept = default; /** * Accept method for the visitor pattern, visits each field in the collection. @@ -133,7 +141,7 @@ private: * Telemetry fields visitor interface class. A backend to log to a web service should implement * this interface. */ -struct VisitorInterface : NonCopyable { +struct VisitorInterface { virtual ~VisitorInterface() = default; virtual void Visit(const Field& field) = 0; @@ -160,8 +168,8 @@ struct VisitorInterface : NonCopyable { * Empty implementation of VisitorInterface that drops all fields. Used when a functional * backend implementation is not available. */ -struct NullVisitor : public VisitorInterface { - ~NullVisitor() = default; +struct NullVisitor final : public VisitorInterface { + YUZU_NON_COPYABLE(NullVisitor); void Visit(const Field& /*field*/) override {} void Visit(const Field& /*field*/) override {} -- cgit v1.2.3