Merge branch 'master' into graphics-next
This commit is contained in:
@@ -58,9 +58,20 @@ namespace Nz
|
||||
* \return ObjectHandle to this
|
||||
*/
|
||||
template<typename T>
|
||||
ObjectHandle<T> HandledObject<T>::CreateHandle()
|
||||
template<typename U>
|
||||
ObjectHandle<U> HandledObject<T>::CreateHandle()
|
||||
{
|
||||
return ObjectHandle<T>(static_cast<T*>(this));
|
||||
static_assert(std::is_base_of<T, U>::value, "Cannot retrieve a handle for a non-related class");
|
||||
return ObjectHandle<U>(static_cast<U*>(this));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::shared_ptr<const Detail::HandleData> HandledObject<T>::GetHandleData()
|
||||
{
|
||||
if (!m_handleData)
|
||||
InitHandleData();
|
||||
|
||||
return std::shared_ptr<const Detail::HandleData>(m_handleData);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -112,15 +123,6 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::shared_ptr<const Detail::HandleData> HandledObject<T>::GetHandleData()
|
||||
{
|
||||
if (!m_handleData)
|
||||
InitHandleData();
|
||||
|
||||
return std::shared_ptr<const Detail::HandleData>(m_handleData);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void HandledObject<T>::InitHandleData()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user