ref_counter is a reference counter. More...
#include <reference_counter.hpp>
Public Types | |
enum | { NEW =0 , NOT_COUNTED = -1 } |
Public Member Functions | |
ref_counter (T_integral x=0) | |
ref_counter (const ref_counter &a) | |
ref_counter & | operator= (const ref_counter &a) |
operator T_integral const () const | |
T_integral const | set (T_integral const a) |
T_integral const | inc () |
T_integral const | dec () |
T_integral const | enable_count () |
T_integral const | disable_count () |
T_integral const | operator++ () |
T_integral const | operator++ (int) |
T_integral const | operator-- () |
T_integral const | operator-- (int) |
Private Attributes | |
T_integral | count_ |
ref_counter is a reference counter.
If the counter overflows it stops counting. So any negative count disables reference counting.
Definition at line 33 of file reference_counter.hpp.
anonymous enum |
Enumerator | |
---|---|
NEW | |
NOT_COUNTED |
Definition at line 39 of file reference_counter.hpp.
|
inlineexplicit |
Definition at line 41 of file reference_counter.hpp.
|
inline |
Definition at line 42 of file reference_counter.hpp.
|
inline |
Definition at line 51 of file reference_counter.hpp.
References n_ref_counter::ref_counter< T_integral >::count_.
Referenced by n_ref_counter::ref_counter< T_integral >::operator--().
|
inline |
Definition at line 57 of file reference_counter.hpp.
References n_ref_counter::ref_counter< T_integral >::count_, and n_ref_counter::ref_counter< T_integral >::NOT_COUNTED.
|
inline |
Definition at line 54 of file reference_counter.hpp.
References n_ref_counter::ref_counter< T_integral >::count_.
|
inline |
Definition at line 48 of file reference_counter.hpp.
References n_ref_counter::ref_counter< T_integral >::count_.
Referenced by n_ref_counter::ref_counter< T_integral >::operator++().
|
inline |
Definition at line 45 of file reference_counter.hpp.
|
inline |
Definition at line 61 of file reference_counter.hpp.
References n_ref_counter::ref_counter< T_integral >::inc().
|
inline |
Definition at line 62 of file reference_counter.hpp.
References n_ref_counter::ref_counter< T_integral >::count_, and n_ref_counter::ref_counter< T_integral >::inc().
|
inline |
Definition at line 63 of file reference_counter.hpp.
References n_ref_counter::ref_counter< T_integral >::dec().
|
inline |
Definition at line 64 of file reference_counter.hpp.
References n_ref_counter::ref_counter< T_integral >::count_, and n_ref_counter::ref_counter< T_integral >::dec().
|
inline |
Definition at line 43 of file reference_counter.hpp.
References n_ref_counter::ref_counter< T_integral >::count_.
|
inline |
Definition at line 47 of file reference_counter.hpp.
References n_ref_counter::ref_counter< T_integral >::count_.
|
private |
Definition at line 36 of file reference_counter.hpp.
Referenced by n_ref_counter::ref_counter< T_integral >::dec(), n_ref_counter::ref_counter< T_integral >::disable_count(), n_ref_counter::ref_counter< T_integral >::enable_count(), n_ref_counter::ref_counter< T_integral >::inc(), n_ref_counter::ref_counter< signed int >::operator signed int const(), n_ref_counter::ref_counter< T_integral >::operator++(), n_ref_counter::ref_counter< T_integral >::operator--(), n_ref_counter::ref_counter< T_integral >::operator=(), and n_ref_counter::ref_counter< T_integral >::set().