IReleasable



Describes releasable object.

You can find more information in comments below.

class IReleasable
{
protected:
    int m_iRefCount;
public:
    int const &RefCount{ m_iRefCount }; // Reference counter 

    virtual int AddRef() = 0; // Increase reference counter and return its new value 
    virtual bool Release(const bool force = false) = 0; // Decrease reference counter and destroy object if counter becomes zero. If force is true, destroy object anyway. Return true if object is destroyed and false if not 
};
Namespace: nitisa
Include: Nitisa/Interfaces/IReleasable.h