55 template <
typename Val >
62 template <
typename Val >
72 template <
typename Val >
73 template <
typename DownVal >
83 template <
typename Val >
98 template <
typename Val >
106 Val* old_val =
_val_;
123 template <
typename Val >
131 Val* old_val =
_val_;
139 }
catch (std::bad_alloc&) {
140 if (*old_refcount == 1) {
160 template <
typename Val >
161 template <
typename DownVal >
166 Val* old_val =
_val_;
182 template <
typename Val >
190 template <
typename Val >
197 template <
typename Val >
204 template <
typename Val >
213 template <
typename Val >
222 template <
typename Val >
231 template <
typename Val >
238 template <
typename Val >
242 Val* old_val =
_val_;
252 template <
typename Val >
261 template <
typename Val >
268 template <
typename Val >
271 Val* tmp_val = ptr2.
_val_;
277 ptr1.
_val_ = tmp_val;
Exception : a pointer or a reference on a nullptr (0) object.
friend class RefPtr
A friend to allow downcastings.
~RefPtr()
Class destructor.
unsigned int * _refcount_
A reference counter on *val.
bool operator==(const RefPtr< Val > &from) const
Checks whether two RefPtr<Val> are smart pointers for the same element.
unsigned int refCount() const
Returns the number of smart pointer referencing the contained pointer.
void _destroy_(unsigned int *, Val *)
A function to remove the content of the smart pointer, if any.
Val * operator->() const
Dereferencing operator.
unsigned int * _refCountPtr_() const
A function to return the refcount pointer.
Val * _val_
The dumb pointer encapsulated into the "smart" pointer.
RefPtr< Val > & operator=(const RefPtr< Val > &from)
Copy operator.
void clear()
Makes the smart pointer point to 0.
Val & operator*()
Dereferencing operator.
bool operator!=(const RefPtr< Val > &from) const
Checks whether two RefPtr<Val> are smart pointers for different elements.
#define GUM_ERROR(type, msg)
void swap(RefPtr< Val > &ptr1, RefPtr< Val > &ptr2)
Swap the contents of two RefPtr.
gum is the global namespace for all aGrUM entities
Class providing aGrUM's "smart" pointers.