Simplifying debug settings classes

Change-Id: Ie7039b5ee7f5979564c4697c5d51c2b0a29e5bc2
Signed-off-by: Andrzej Koska <andrzej.koska@intel.com>
Related-To: NEO-3239
This commit is contained in:
Koska, Andrzej
2019-09-25 12:17:04 +02:00
committed by sys_ocldev
parent a7daa599fd
commit 7fa3865f0b

View File

@@ -46,33 +46,26 @@ class GraphicsAllocation;
struct MultiDispatchInfo;
class SettingsReader;
// clang-format off
#define DECLARE_DEBUG_VARIABLE(dataType, variableName, defaultValue, description) \
struct DebugVar##variableName \
{ \
DebugVar##variableName() { \
value = (dataType)defaultValue; \
} \
dataType get() const { \
return value; \
} \
void set(dataType data) { \
value = data; \
} \
dataType &getRef() { \
return value; \
} \
private: \
dataType value; \
};
template <typename T>
struct DebugVarBase {
DebugVarBase(const T &defaultValue) : value(defaultValue) {}
T get() const {
return value;
}
void set(T data) {
value = std::move(data);
}
T &getRef() {
return value;
}
#include "debug_variables.inl"
#undef DECLARE_DEBUG_VARIABLE
// clang-format on
private:
T value;
};
struct DebugVariables {
#define DECLARE_DEBUG_VARIABLE(dataType, variableName, defaultValue, description) \
DebugVar##variableName variableName;
DebugVarBase<dataType> variableName{defaultValue};
#include "debug_variables.inl"
#undef DECLARE_DEBUG_VARIABLE
};