33 #if defined(CowPtr_RECURSES) 34 #error Recursive header files inclusion detected in CowPtr.h 35 #else // defined(CowPtr_RECURSES) 37 #define CowPtr_RECURSES 46 #include <type_traits> 47 #include "DGtal/base/Common.h" 48 #include "DGtal/base/CountedPtr.h" 91 const T*
get()
const throw() {
return myPtr.get();}
112 template < typename U = T, typename std::enable_if< ! std::is_const<U>::value >::type* =
nullptr >
115 template < typename U = T, typename std::enable_if< ! std::is_const<U>::value >::type* =
nullptr >
118 template < typename U = T, typename std::enable_if< ! std::is_const<U>::value >::type* =
nullptr >
129 return get() == other;
140 return get() != other;
163 T* old_p = myPtr.
get();
201 template <
typename T>
203 operator<< ( std::ostream & out, const CowPtr<T> & object );
210 #include "DGtal/base/CowPtr.ih" 215 #endif // !defined CowPtr_h 217 #undef CowPtr_RECURSES 218 #endif // else defined(CowPtr_RECURSES)
bool operator==(const T *other) const
void selfDisplay(std::ostream &out) const
Aim: Smart pointer based on reference counts.
bool operator!=(const T *other) const
const T * operator->() const
const T & operator*() const
CowPtr(const CountedPtr< T > &r)
unsigned int count() const
CowPtr & operator=(const CowPtr &r)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Copy on write shared pointer.