Files
Aerofoil/PortabilityLayer/RefCounted.h
Diomendius 1b18a87495 Normalize line endings
This commit contains only the result of `git add --renormalize .`

`git show --ignore-space-change` can verify that this commit only
changes whitespace.
2024-07-31 20:21:47 +12:00

39 lines
557 B
C++

#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();
}