DGtal
0.9.4.1
|
#include <DGtal/base/CowPtr.h>
Public Types | |
typedef T | element_type |
Public Member Functions | |
CowPtr (T *p=0) noexcept | |
CowPtr (const CowPtr &r) noexcept | |
CowPtr (const CountedPtr< T > &r) | |
CowPtr & | operator= (const CowPtr &r) |
const T & | operator* () const noexcept |
const T * | operator-> () const noexcept |
const T * | get () const noexcept |
template<typename U = T, typename std::enable_if< ! std::is_const< U >::value >::type * = nullptr> | |
T & | operator* () |
template<typename U = T, typename std::enable_if< ! std::is_const< U >::value >::type * = nullptr> | |
T * | operator-> () |
template<typename U = T, typename std::enable_if< ! std::is_const< U >::value >::type * = nullptr> | |
T * | get () |
bool | operator== (const T *other) const |
bool | operator!= (const T *other) const |
unsigned int | count () const |
T * | drop () |
bool | unique () const noexcept |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Member Functions | |
void | copy () |
Private Attributes | |
CountedPtr< T > | myPtr |
Aim: Copy on write shared pointer.
Description of template class 'CowPtr'
Use reference counting as long as the pointed object is not modified. When it is about to be modified, copy it and modify the copy.
typedef T DGtal::CowPtr< T >::element_type |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inline |
|
inlineprivate |
Definition at line 160 of file CowPtr.h.
Referenced by DGtal::CowPtr< Domain >::get(), DGtal::CowPtr< Domain >::operator*(), and DGtal::CowPtr< Domain >::operator->().
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
bool DGtal::CowPtr< T >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Referenced by DGtal::Image< TImageContainer >::isValid().
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
void DGtal::CowPtr< T >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
inlinenoexcept |
|
private |
Definition at line 156 of file CowPtr.h.
Referenced by DGtal::CowPtr< Domain >::copy(), DGtal::CowPtr< Domain >::count(), DGtal::CowPtr< Domain >::drop(), DGtal::CowPtr< Domain >::get(), DGtal::CowPtr< Domain >::operator*(), DGtal::CowPtr< Domain >::operator->(), DGtal::CowPtr< Domain >::operator=(), and DGtal::CowPtr< Domain >::unique().