Separating declaration and definition of RefPtr

This commit is contained in:
HOEGLER Stefan
2020-03-08 13:38:40 +01:00
parent df3ed3c49e
commit 9bff657419
14 changed files with 1940 additions and 34 deletions
+13
View File
@@ -5,6 +5,10 @@
#include <atomic>
#include "Math/Math.h"
#define DEFINE_REF(x) typedef RefPtr<x> P##x; \
typedef UniquePtr<x> UP##x; \
typedef WeakPtr<x> W##x;
#define DECLARE_REF(x) class x; \
typedef RefPtr<x> P##x; \
typedef UniquePtr<x> UP##x; \
@@ -60,11 +64,20 @@ namespace Seele
{
return object == other.object;
}
bool operator!=(const RefPtr& other) const
{
return object != other.object;
}
T* operator->()
{
assert(object != nullptr);
return object->getHandle();
}
const T* operator->() const
{
assert(object != nullptr);
return object->getHandle();
}
private:
class RefObject