DGtal  1.3.beta
Public Member Functions | Data Fields
DGtal::CountedPtr< T >::Counter Struct Reference

#include <DGtal/base/CountedPtr.h>

Public Member Functions

 Counter (T *p=0, unsigned c=1)
 

Data Fields

T * ptr
 A pointer to a (shared) dynamically allocated object of type T. More...
 
unsigned count
 The number of CountedPtr pointing to this counter. More...
 

Detailed Description

template<typename T>
struct DGtal::CountedPtr< T >::Counter

Internal structure for storing a smart pointer. Counts the number of references to some dynamically allocated object of type T in memory.

Definition at line 93 of file CountedPtr.h.

Constructor & Destructor Documentation

◆ Counter()

template<typename T >
DGtal::CountedPtr< T >::Counter::Counter ( T *  p = 0,
unsigned  c = 1 
)
inline

Builds a counter, i.e. a pair pointer/integer.

Parameters
peither 0 and the counter is invalid, or a pointer to some dynamically allocated object of type T.
cthe number of CountedPtr currently pointing to this counter.

Definition at line 103 of file CountedPtr.h.

103 : ptr(p), count(c) {}

Field Documentation

◆ count

template<typename T >
unsigned DGtal::CountedPtr< T >::Counter::count

◆ ptr

template<typename T >
T* DGtal::CountedPtr< T >::Counter::ptr

The documentation for this struct was generated from the following file:
DGtal::CountedPtr::Counter::ptr
T * ptr
A pointer to a (shared) dynamically allocated object of type T.
Definition: CountedPtr.h:105
DGtal::CountedPtr::Counter::count
unsigned count
The number of CountedPtr pointing to this counter.
Definition: CountedPtr.h:107