24#ifndef SO_AUTO_REF_COUNTER_H
25#define SO_AUTO_REF_COUNTER_H
55 : m_pointer(that.m_pointer)
79 (*this) = that.m_pointer;
101 return m_pointer == other.m_pointer;
106 return m_pointer != other.m_pointer;
111 return m_pointer < other.m_pointer;
116 return m_pointer < other.m_pointer;
121 return m_pointer > other.m_pointer;
126 return m_pointer > other.m_pointer;
133 return m_pointer ==
ptr;
138 return m_pointer !=
ptr;
143 return m_pointer <
ptr;
148 return m_pointer <
ptr;
153 return m_pointer >
ptr;
158 return m_pointer >
ptr;
162 operator bool()
const
164 return get() !=
nullptr;
170 return get() ==
nullptr;
187 {
return m_pointer; }
196 return ptr == ref.
ptr();
201 return ptr != ref.
ptr();
206 return ptr < ref.
ptr();
211 return ptr <= ref.
ptr();
216 return ptr > ref.
ptr();
221 return ptr >= ref.
ptr();
static bool operator<(const SoRefCounter *ptr, const SoAutoRef &ref)
static bool operator==(const SoRefCounter *ptr, const SoAutoRef &ref)
static bool operator<=(const SoRefCounter *ptr, const SoAutoRef &ref)
static bool operator!=(const SoRefCounter *ptr, const SoAutoRef &ref)
static bool operator>=(const SoRefCounter *ptr, const SoAutoRef &ref)
static bool operator>(const SoRefCounter *ptr, const SoAutoRef &ref)
Implements smart pointers to SoRefCounter objects.
SoRefCounter * operator->() const
Cast to C pointer.
bool operator<(const SoAutoRef &other) const
bool operator!=(const SoRefCounter *ptr) const
bool operator==(const SoRefCounter *ptr) const
bool operator<=(const SoAutoRef &other) const
bool operator!() const
NOT operator.
bool operator<=(const SoRefCounter *ptr) const
SoAutoRef & operator=(const SoAutoRef &that)
Assign another SoAutoRef.
bool operator!=(const SoAutoRef &other) const
SoRefCounter * ptr() const
Cast to C pointer.
bool operator==(const SoAutoRef &other) const
SoAutoRef()
Default constructor.
bool operator<(const SoRefCounter *ptr) const
bool operator>(const SoAutoRef &other) const
bool operator>=(const SoAutoRef &other) const
SoAutoRef(SoRefCounter *pIn)
Construct from C++ pointer.
SoAutoRef & operator=(SoRefCounter *ptr)
Assign ordinary C pointer.
bool operator>=(const SoRefCounter *ptr) const
SoAutoRef(const SoAutoRef &that)
Copy constructor.
bool operator>(const SoRefCounter *ptr) const
SoRefCounter & operator*() const
Dereference pointer.
Base class for ref-counted objects.
void unref() const
Removes a reference from an instance.
void ref() const
Adds a reference to an instance.