refcount_ptr.h Source File
Back to the index.
Go to the documentation of this file.
76 if (m_refCount != 0) {
77 std::cerr <<
"TODO: ~ReferenceCountable count != 0!\n";
90 int increase_refcount()
const
92 return (++ m_refCount);
101 int decrease_refcount()
const
103 return (-- m_refCount);
107 mutable int m_refCount;
133 m_p->increase_refcount();
156 m_p->increase_refcount();
170 if (
this != &other) {
172 if ((m_p = other.m_p) != NULL)
173 m_p->increase_refcount();
194 operator const T* ()
const
231 std::ptrdiff_t diff = m_p - other.m_p;
245 return m_p == other.m_p;
258 return m_p != other.m_p;
271 if (m_p->decrease_refcount() <= 0)
281 #endif // REFCOUNT_PTR_H
bool IsNULL() const
Checks whether or not an object is referenced by the reference counted pointer.
refcount_ptr(const refcount_ptr &other)
bool operator<(const refcount_ptr &other) const
Less-than operator, e.g. for sorting.
bool operator!=(const refcount_ptr &other) const
Not-Equals operator.
A template class representing a reference counted pointer.
refcount_ptr & operator=(const refcount_ptr &other)
bool operator==(const refcount_ptr &other) const
Equals operator.
ReferenceCountable()
Default constructor, which initializes the reference count to zero.
Base class for reference countable objects.
Generated on Tue Mar 24 2020 14:04:48 for GXemul by
1.8.17