35 #include <agrum/agrum.h> 39 #ifndef DOXYGEN_SHOULD_SKIP_THIS 41 template <
typename Val >
44 template <
typename Val >
59 template <
typename Val >
115 template <
typename Val >
149 explicit RefPtr(Val* val = 0);
162 template <
typename DownVal >
254 template <
typename DownVal >
329 template <
typename T >
333 template <
typename T >
352 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 353 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 354 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 355 extern template class gum::
RefPtr<
int >;
359 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 360 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 361 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 362 extern template class gum::
RefPtr<
long >;
367 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 368 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 369 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 370 extern template class gum::
RefPtr<
double >;
377 #include <agrum/tools/core/refPtr_tpl.h> RefPtr< Val > & operator=(const RefPtr< Val > &from)
Copy operator.
friend class RefPtr
A friend to allow downcastings.
~RefPtr()
Class destructor.
Val * operator->() const
Dereferencing operator.
RefPtr< Val > & operator=(Val *from)
Copy operator.
INLINE void emplace(Args &&... args)
operator bool() const
Checks whether a RefPtr points toward something.
friend void swap(RefPtr< Val > &, RefPtr< Val > &)
The swap function must access to gum::RefPtr private parts.
RefPtr(const RefPtr< DownVal > &from)
Copy constructor for downcastable pointers.
friend class HashFunc
A friend for hashing quickly ref pointers.
unsigned int * _refcount_
A reference counter on *val.
const Val & operator*() const
Const dereferencing operator.
bool operator!=(const RefPtr< Val > &from) const
Checks whether two RefPtr<Val> are smart pointers for different elements.
RefPtr< Val > & operator=(const RefPtr< DownVal > &from)
Copy operator for downcastable pointers.
bool operator==(const RefPtr< Val > &from) const
Checks whether two RefPtr<Val> are smart pointers for the same element.
unsigned int * _refCountPtr_() const
A function to return the refcount pointer.
void clear()
Makes the smart pointer point to 0.
RefPtr(Val *val=0)
Default constructor.
Val * _val_
The dumb pointer encapsulated into the "smart" pointer.
Val & operator*()
Dereferencing operator.
void swap(RefPtr< Val > &ptr1, RefPtr< Val > &ptr2)
Swap the contents of two RefPtr.
RefPtr(const RefPtr< Val > &from)
Copy constructor.
void _destroy_(unsigned int *, Val *)
A function to remove the content of the smart pointer, if any.
unsigned int refCount() const
Returns the number of smart pointer referencing the contained pointer.