#include "ReferenceCounter.h"

using namespace Framework;

ReferenceCounter::ReferenceCounter()
{
    ref = 1;
}

ReferenceCounter::~ReferenceCounter() {}

int ReferenceCounter::getReferenceCount() const
{
    return ref;
}

ReferenceCounter* ReferenceCounter::getThis()
{
    ref++;
    return this;
}

void* ReferenceCounter::release()
{
    if (!--ref) delete this;
    return 0;
}