Added a static New method to RefCounted-derived classes
Former-commit-id: efd9e68e050fb6cc7e0df7a7c222ca759c502dc5
This commit is contained in:
@@ -23,6 +23,7 @@ class NzObjectRef
|
||||
NzObjectRef(NzObjectRef&& ref) noexcept;
|
||||
~NzObjectRef();
|
||||
|
||||
T* Get() const;
|
||||
bool IsValid() const;
|
||||
T* Release();
|
||||
bool Reset(T* object = nullptr);
|
||||
|
||||
@@ -41,6 +41,12 @@ NzObjectRef<T>::~NzObjectRef()
|
||||
m_object->RemoveReference();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* NzObjectRef<T>::Get() const
|
||||
{
|
||||
return m_object;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool NzObjectRef<T>::IsValid() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user