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 >
138 if(
object && object->removeReference() <= 0)
delete object;
145 template <
class Object >
151 template <
class Object >
157 template <
class Object >
159 return object == rhs.
object;
163 template <
class Object >
165 return object != rhs.
object;
169 template <
class Object >
175 template <
class Object >
177 if(
object != 0 && object->isShared()) {
180 object->removeReference();
181 object =
static_cast<Object *
>(
object->clone());
186 #endif // CLASSIC_Pointer_HH
Object & operator*() const
Dereferencing operator.
Object * operator->() const
Delegation operator.
Pointer & operator=(const Pointer &)
Assign.
Pointer()
Default constructor.
bool operator!=(const Pointer &) const
Pointer inequality.
int addReference() const
Increment reference count.
Reference-counted pointer.
bool isValid() const
Test for validity.
void unique()
Force unique.
The base class for all OPAL objects.
bool operator==(const Pointer &) const
Pointer equality.