Lots of stuff

This commit is contained in:
elasota
2019-11-11 00:11:59 -05:00
parent 49a35bb15b
commit c8472f7295
406 changed files with 58313 additions and 88 deletions

View File

@@ -0,0 +1,38 @@
#pragma once
namespace PortabilityLayer
{
class RefCountedBase
{
public:
RefCountedBase();
virtual ~RefCountedBase();
virtual void Release() = 0;
void IncRef();
void DecRef();
private:
unsigned int m_refCount;
};
}
inline PortabilityLayer::RefCountedBase::RefCountedBase()
: m_refCount(0)
{
}
inline PortabilityLayer::RefCountedBase::~RefCountedBase()
{
}
inline void PortabilityLayer::RefCountedBase::IncRef()
{
m_refCount++;
}
inline void PortabilityLayer::RefCountedBase::DecRef()
{
if (--m_refCount == 0)
this->Release();
}