72template<
typename RESOURCE>
96 other.mResource =
nullptr;
131 other.mResource =
nullptr;
144 operator RESOURCE *()
const
A class for loading and managing resources.
Automatically counting Resource reference.
ResourceRef(RESOURCE *resource=nullptr)
ResourceRef & operator=(ResourceRef &&other)
ResourceRef(const ResourceRef &other)
RESOURCE * operator->() const
ResourceRef(ResourceRef &&other)
ResourceRef & operator=(const ResourceRef &other)
RESOURCE * release()
Releases the resource without decrementing the reference count!
A generic reference counted resource object.
std::string mIdPath
Path identifying this resource.
void incRef()
Increments the internal reference count.
virtual ~Resource()=default
const std::string & getIdPath() const
Return the path identifying this resource.
time_t mTimeStamp
Time at which the resource was orphaned.
void decRef(OrphanPolicy orphanPolicy=DeleteLater)
Decrements the reference count.
unsigned mRefCount
Reference count.