Rename IsNXTBitMask and NxtReference/Release to dawn

This commit is contained in:
Corentin Wallez 2018-07-18 15:26:19 +02:00 committed by Corentin Wallez
parent a5ee52d33e
commit 923574eed5
5 changed files with 16 additions and 16 deletions

View File

@ -112,12 +112,12 @@ namespace dawn {
{% endif %}
}
{% endfor %}
void {{CppType}}::NxtReference({{CType}} handle) {
void {{CppType}}::DawnReference({{CType}} handle) {
if (handle != nullptr) {
{{as_cMethod(type.name, Name("reference"))}}(handle);
}
}
void {{CppType}}::NxtRelease({{CType}} handle) {
void {{CppType}}::DawnRelease({{CType}} handle) {
if (handle != nullptr) {
{{as_cMethod(type.name, Name("release"))}}(handle);
}

View File

@ -41,7 +41,7 @@ namespace dawn {
{% for type in by_category["bitmask"] %}
template<>
struct IsNXTBitmask<{{as_cppType(type.name)}}> {
struct IsDawnBitmask<{{as_cppType(type.name)}}> {
static constexpr bool enable = true;
};
@ -72,10 +72,10 @@ namespace dawn {
public:
ObjectBase() = default;
ObjectBase(CType handle): mHandle(handle) {
if (mHandle) Derived::NxtReference(mHandle);
if (mHandle) Derived::DawnReference(mHandle);
}
~ObjectBase() {
if (mHandle) Derived::NxtRelease(mHandle);
if (mHandle) Derived::DawnRelease(mHandle);
}
ObjectBase(ObjectBase const& other) = delete;
@ -88,7 +88,7 @@ namespace dawn {
Derived& operator=(ObjectBase&& other) {
if (&other == this) return static_cast<Derived&>(*this);
if (mHandle) Derived::NxtRelease(mHandle);
if (mHandle) Derived::DawnRelease(mHandle);
mHandle = other.mHandle;
other.mHandle = 0;
@ -152,8 +152,8 @@ namespace dawn {
private:
friend ObjectBase<{{CppType}}, {{CType}}>;
static void NxtReference({{CType}} handle);
static void NxtRelease({{CType}} handle);
static void DawnReference({{CType}} handle);
static void DawnRelease({{CType}} handle);
};
{% endfor %}

View File

@ -39,7 +39,7 @@ namespace dawn {
#endif
template <typename T>
struct IsNXTBitmask {
struct IsDawnBitmask {
static constexpr bool enable = false;
};
@ -49,7 +49,7 @@ namespace dawn {
};
template <typename T>
struct LowerBitmask<T, typename std::enable_if<IsNXTBitmask<T>::enable>::type> {
struct LowerBitmask<T, typename std::enable_if<IsDawnBitmask<T>::enable>::type> {
static constexpr bool enable = true;
using type = T;
constexpr static T Lower(T t) {
@ -130,7 +130,7 @@ namespace dawn {
template <typename T,
typename T2,
typename = typename std::enable_if<IsNXTBitmask<T>::enable &&
typename = typename std::enable_if<IsDawnBitmask<T>::enable &&
LowerBitmask<T2>::enable>::type>
constexpr T& operator&=(T& l, T2 right) {
T r = LowerBitmask<T2>::Lower(right);
@ -140,7 +140,7 @@ namespace dawn {
template <typename T,
typename T2,
typename = typename std::enable_if<IsNXTBitmask<T>::enable &&
typename = typename std::enable_if<IsDawnBitmask<T>::enable &&
LowerBitmask<T2>::enable>::type>
constexpr T& operator|=(T& l, T2 right) {
T r = LowerBitmask<T2>::Lower(right);
@ -150,7 +150,7 @@ namespace dawn {
template <typename T,
typename T2,
typename = typename std::enable_if<IsNXTBitmask<T>::enable &&
typename = typename std::enable_if<IsDawnBitmask<T>::enable &&
LowerBitmask<T2>::enable>::type>
constexpr T& operator^=(T& l, T2 right) {
T r = LowerBitmask<T2>::Lower(right);

View File

@ -26,7 +26,7 @@ namespace dawn {
};
template<>
struct IsNXTBitmask<Color> {
struct IsDawnBitmask<Color> {
static constexpr bool enable = true;
};

View File

@ -21,11 +21,11 @@ class Object : public dawn::ObjectBase<Object, int*> {
using ObjectBase::ObjectBase;
using ObjectBase::operator=;
static void NxtReference(int* handle) {
static void DawnReference(int* handle) {
ASSERT_LT(0, *handle);
*handle += 1;
}
static void NxtRelease(int* handle) {
static void DawnRelease(int* handle) {
ASSERT_LT(0, *handle);
*handle -= 1;
}