lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
lean::smart::ref_counter< Counter, Allocator > Class Template Reference

Reference counter class that maintains strong and weak reference counts. More...

#include <ref_counter.h>

List of all members.

Classes

class  ref_counts
 Reference counter structure. More...

Public Types

typedef Counter counter_type
 Type of the counter used by this class.
typedef Allocator allocator_type
 Type of the allocator used by this class.

Public Member Functions

void release (ref_counts *counts)
 Releases the given internal reference counting object.
 ref_counter (ref_counts *counts)
 Special constructor.
 ref_counter (counter_type references=1)
 Constructor.
 ref_counter (allocator_type allocator)
 Constructor.
 ref_counter (counter_type references, allocator_type allocator)
 Constructor.
 ref_counter (const ref_counter &refCounter)
 Copy constructor.
 ~ref_counter () throw ()
 Destructor.
ref_counteroperator= (const ref_counter &refCounter)
 Assignment operator. [ESA]
bool increment_checked () const
 Increments the current reference count.
counter_type increment () const
 Increments the current reference count.
counter_type decrement () const
 Decrements the current reference count.
LEAN_INLINE bool is_null ()
 Checks whether this reference counter is in a valid state.
LEAN_INLINE counter_type count () const
 Gets the current reference count.
LEAN_INLINE bool valid () const
 Gets whether the reference-counted object still exists (<==> reference count > 0).
LEAN_INLINE counter_type weak_count () const
 Gets the current weak reference count.
LEAN_INLINE ref_counteroperator++ ()
 Increments the current reference count.
LEAN_INLINE const ref_counteroperator++ () const
 Increments the current reference count.
LEAN_INLINE ref_counteroperator-- ()
 Decrements the current reference count.
LEAN_INLINE const ref_counteroperator-- () const
 Decrements the current reference count.
LEAN_INLINE counter_type operator++ (int) const
 Increments the current reference count.
LEAN_INLINE counter_type operator-- (int) const
 Decrements the current reference count.
LEAN_INLINE operator counter_type () const
 Gets the current reference count.
LEAN_INLINE operator bool () const
 Gets whether the reference-counted object still exists (<==> reference count > 0).

Static Public Member Functions

static ref_countsacquire (ref_counts *counts)
 Acquires the given internal reference counting object.
static LEAN_INLINE ref_counter null ()
 Gets a null reference counter that may only be copied from and assigned to.

Public Attributes

ref_countsm_counts

Detailed Description

template<class Counter = long, class Allocator = std::allocator<Counter>>
class lean::smart::ref_counter< Counter, Allocator >

Reference counter class that maintains strong and weak reference counts.


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