1 #ifndef CLASSIC_Pointer_HH
2 #define CLASSIC_Pointer_HH
37 template <
class Object >
98 template <
class Object >
104 template <
class Object >
107 if(
object)
object->addReference();
111 template <
class Object >
114 if(
object)
object->addReference();
118 template <
class Object >
120 if(
object && object->removeReference() <= 0)
delete object;
124 template <
class Object >
126 if(
object != rhs.
object) {
127 if(
object != 0 && object->removeReference() <= 0)
delete object;
136 template <
class Object >
139 if(
object && object->removeReference() <= 0)
delete object;
147 template <
class Object >
153 template <
class Object >
159 template <
class Object >
161 return object == rhs.
object;
165 template <
class Object >
167 return object != rhs.
object;
171 template <
class Object >
177 template <
class Object >
179 if(
object != 0 && object->isShared()) {
182 object->removeReference();
183 object =
static_cast<Object *
>(
object->clone());
The base class for all OPAL objects.
Reference-counted pointer.
bool isValid() const
Test for validity.
void unique()
Force unique.
Pointer & operator=(Object *)
Assign.
Object & operator*() const
Dereferencing operator.
Pointer(Object *)
Constructor.
Pointer()
Default constructor.
Object * operator->() const
Delegation operator.
Pointer & operator=(const Pointer &)
Assign.
bool operator==(const Pointer &) const
Pointer equality.
Pointer(const Pointer &)
Copy constructor.
bool operator!=(const Pointer &) const
Pointer inequality.
int addReference() const
Increment reference count.