summaryrefslogtreecommitdiff
path: root/src/common/telemetry.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/telemetry.h')
-rw-r--r--src/common/telemetry.h26
1 files changed, 17 insertions, 9 deletions
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 @@
8#include <map> 8#include <map>
9#include <memory> 9#include <memory>
10#include <string> 10#include <string>
11#include "common/common_funcs.h"
11#include "common/common_types.h" 12#include "common/common_types.h"
12 13
13namespace Common::Telemetry { 14namespace Common::Telemetry {
@@ -28,7 +29,7 @@ struct VisitorInterface;
28/** 29/**
29 * Interface class for telemetry data fields. 30 * Interface class for telemetry data fields.
30 */ 31 */
31class FieldInterface : NonCopyable { 32class FieldInterface {
32public: 33public:
33 virtual ~FieldInterface() = default; 34 virtual ~FieldInterface() = default;
34 35
@@ -52,14 +53,15 @@ public:
52template <typename T> 53template <typename T>
53class Field : public FieldInterface { 54class Field : public FieldInterface {
54public: 55public:
56 YUZU_NON_COPYABLE(Field);
57
55 Field(FieldType type_, std::string name_, T value_) 58 Field(FieldType type_, std::string name_, T value_)
56 : name(std::move(name_)), type(type_), value(std::move(value_)) {} 59 : name(std::move(name_)), type(type_), value(std::move(value_)) {}
57 60
58 Field(const Field&) = default; 61 ~Field() override = default;
59 Field& operator=(const Field&) = default;
60 62
61 Field(Field&&) = default; 63 Field(Field&&) noexcept = default;
62 Field& operator=(Field&& other) = default; 64 Field& operator=(Field&& other) noexcept = default;
63 65
64 void Accept(VisitorInterface& visitor) const override; 66 void Accept(VisitorInterface& visitor) const override;
65 67
@@ -98,9 +100,15 @@ private:
98/** 100/**
99 * Collection of data fields that have been logged. 101 * Collection of data fields that have been logged.
100 */ 102 */
101class FieldCollection final : NonCopyable { 103class FieldCollection final {
102public: 104public:
105 YUZU_NON_COPYABLE(FieldCollection);
106
103 FieldCollection() = default; 107 FieldCollection() = default;
108 ~FieldCollection() = default;
109
110 FieldCollection(FieldCollection&&) noexcept = default;
111 FieldCollection& operator=(FieldCollection&&) noexcept = default;
104 112
105 /** 113 /**
106 * Accept method for the visitor pattern, visits each field in the collection. 114 * Accept method for the visitor pattern, visits each field in the collection.
@@ -133,7 +141,7 @@ private:
133 * Telemetry fields visitor interface class. A backend to log to a web service should implement 141 * Telemetry fields visitor interface class. A backend to log to a web service should implement
134 * this interface. 142 * this interface.
135 */ 143 */
136struct VisitorInterface : NonCopyable { 144struct VisitorInterface {
137 virtual ~VisitorInterface() = default; 145 virtual ~VisitorInterface() = default;
138 146
139 virtual void Visit(const Field<bool>& field) = 0; 147 virtual void Visit(const Field<bool>& field) = 0;
@@ -160,8 +168,8 @@ struct VisitorInterface : NonCopyable {
160 * Empty implementation of VisitorInterface that drops all fields. Used when a functional 168 * Empty implementation of VisitorInterface that drops all fields. Used when a functional
161 * backend implementation is not available. 169 * backend implementation is not available.
162 */ 170 */
163struct NullVisitor : public VisitorInterface { 171struct NullVisitor final : public VisitorInterface {
164 ~NullVisitor() = default; 172 YUZU_NON_COPYABLE(NullVisitor);
165 173
166 void Visit(const Field<bool>& /*field*/) override {} 174 void Visit(const Field<bool>& /*field*/) override {}
167 void Visit(const Field<double>& /*field*/) override {} 175 void Visit(const Field<double>& /*field*/) override {}