DGtal  0.9.2
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
unsigned count

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

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

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

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

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

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