[*] Refactor: drop "leaky" from user data members

[*] ...fix IHasPrivateData
This commit is contained in:
Reece Wilson 2023-06-06 14:06:09 +01:00
parent aa7f783fe9
commit 8667d1059f

View File

@ -24,8 +24,8 @@ namespace Aurora::Utility
// ! Optional Interface: !
struct IHasPrivateData
{
virtual AURT_PRIVATE_DATA_PTR GetData() = 0;
virtual AURT_PRIVATE_DATA_PTR ExchangeData(AURT_PRIVATE_DATA_PTR, AURT_PRIVATE_DATA_PTR) = 0;
virtual AURT_PRIVATE_DATA_PTR PrivateUserDataGet() = 0;
virtual AURT_PRIVATE_DATA_PTR PrivateUserDataExchange(AURT_PRIVATE_DATA_PTR, AURT_PRIVATE_DATA_PTR) = 0;
};
namespace Detail
@ -60,7 +60,7 @@ namespace Aurora::Utility
private: \
Aurora::Utility::Detail::GetPrivateDataImpl _auReservedUserData; \
public:\
inline virtual AURT_PRIVATE_DATA_PTR GetPrivateUserData()\
inline virtual AURT_PRIVATE_DATA_PTR PrivateUserDataGet()\
{\
return this->_auReservedUserData.GetData();\
}\
@ -69,7 +69,7 @@ namespace Aurora::Utility
return this->_auReservedUserData.ExchangeData(pExpect, pReplace);\
}\
template<typename T>\
inline AuSPtr<T> PrivateUserDataLeakyNewData()\
inline AuSPtr<T> PrivateUserDataNewData()\
{\
auto pCurrent = this->_auReservedUserData.pData;\
if (pCurrent) return {};\
@ -78,7 +78,7 @@ namespace Aurora::Utility
return (this->PrivateUserDataExchange(pCurrent, pMaybeTemp)) ? pMaybeTemp : AURT_PRIVATE_DATA_PTR {};\
}\
template<typename T>\
inline AuSPtr<T> PrivateUserDataLeakyGetSharedData()\
inline AuSPtr<T> PrivateUserDataGetSharedData()\
{\
auto pCurrent = this->_auReservedUserData.pData;\
if (pCurrent) return AuReinterpretCast<T>(pCurrent);\