DGtal  1.4.2
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) {}
T * ptr
A pointer to a (shared) dynamically allocated object of type T.
Definition: CountedPtr.h:105
unsigned count
The number of CountedPtr pointing to this counter.
Definition: CountedPtr.h:107

Field Documentation

◆ count

◆ ptr


The documentation for this struct was generated from the following file: