33 #if defined(CountedPtr_RECURSES)
34 #error Recursive header files inclusion detected in CountedPtr.h
37 #define CountedPtr_RECURSES
39 #if !defined CountedPtr_h
46 #include "DGtal/base/Common.h"
51 template <
typename T>
class CountedPtrOrPtr;
52 template <
typename T>
class CountedConstPtrOrConstPtr;
217 return get() == other;
228 return get() != other;
329 template <
typename T>
338 #include "DGtal/base/CountedPtr.ih"
345 #undef CountedPtr_RECURSES
Aim: Smart or simple const pointer on T. It can be a smart pointer based on reference counts or a sim...
Aim: Smart or simple pointer on T. It can be a smart pointer based on reference counts or a simple po...
Aim: Smart pointer based on reference counts.
CountedPtr(const CountedPtr &r) noexcept
CountedPtr & operator=(const CountedPtr &r)
bool unique() const noexcept
bool operator!=(const T *other) const
unsigned int count() const
T * operator->() const noexcept
T & operator*() const noexcept
Counter * myCounter
The counter object pointed by this smart pointer.
void selfDisplay(std::ostream &out) const
bool operator==(const T *other) const
void acquire(Counter *c) noexcept
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
T * ptr
A pointer to a (shared) dynamically allocated object of type T.
unsigned count
The number of CountedPtr pointing to this counter.
Counter(T *p=0, unsigned c=1)