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.
T * operator->() const noexcept
CountedPtr(const CountedPtr &r) noexcept
bool unique() const noexcept
bool operator!=(const T *other) const
unsigned int count() const
CountedPtr & operator=(const CountedPtr &r)
Counter * myCounter
The counter object pointed by this smart pointer.
void selfDisplay(std::ostream &out) const
bool operator==(const T *other) const
T & operator*() const noexcept
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 ClosedIntegerHalfPlane< TSpace > &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)