DGtal 1.4.0
Loading...
Searching...
No Matches
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.
 
unsigned count
 The number of CountedPtr pointing to this counter.
 

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: