Link Decode & CABSFlinch

Former-commit-id: 5e367d95ee
This commit is contained in:
2022-10-16 20:46:11 -04:00
parent f52d22a620
commit d849cbcc10
17 changed files with 89 additions and 85 deletions

View File

@@ -27,12 +27,7 @@ public:
rc_ptr(const rc_ptr& other) : x0_refData(other.x0_refData) { x0_refData->AddRef(); }
~rc_ptr() { ReleaseData(); }
T* GetPtr() const { return static_cast< T* >(x0_refData->GetPtr()); }
void ReleaseData() {
if (x0_refData->DelRef() <= 0) {
delete GetPtr();
delete x0_refData;
}
}
void ReleaseData();
T* operator->() const { return GetPtr(); }
T& operator*() const { return *GetPtr(); }
operator bool() const { return GetPtr() != nullptr; }
@@ -41,6 +36,14 @@ private:
CRefData* x0_refData;
};
template < typename T >
void rc_ptr< T >::ReleaseData() {
if (x0_refData->DelRef() <= 0) {
delete GetPtr();
delete x0_refData;
}
}
template < typename T >
class ncrc_ptr : public rc_ptr< T > {
public: