DGtal 2.0.0
|
Aim: Copy on write shared pointer. More...
#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, bool) | |
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 |
Builds a copy-on-write pointer from a counted pointer. Requires an extra dummy parameter in order to solve ambiguities when casting from Clone<T> to CowPtr<T>.
r | any counted pointer |
|
inlineprivate |
Definition at line 186 of file CowPtr.h.
Referenced by DGtal::CowPtr< StabbingLineComputer< ConstIterator > >::get(), DGtal::CowPtr< StabbingLineComputer< ConstIterator > >::operator*(), and DGtal::CowPtr< StabbingLineComputer< ConstIterator > >::operator->().
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
Definition at line 117 of file CowPtr.h.
Referenced by DGtal::CowPtr< StabbingLineComputer< ConstIterator > >::operator!=(), and DGtal::CowPtr< StabbingLineComputer< ConstIterator > >::operator==().
bool DGtal::CowPtr< T >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
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 182 of file CowPtr.h.
Referenced by DGtal::CowPtr< StabbingLineComputer< ConstIterator > >::operator=().