library of assembled shared sources

http://lass.cocamware.com

lass::util::DefaultCounter Class Reference
[Smart Pointers]

The default counter for the shared pointers, implementation of CounterPolicy concept. More...

#include <smart_ptr_policies.h>


Public Types

typedef int TCount

Protected Member Functions

 DefaultCounter ()
template<typename TStorage >
void init (TStorage &)
template<typename TStorage >
void dispose (TStorage &)
template<typename TStorage >
void increment (TStorage &)
template<typename TStorage >
bool decrement (TStorage &)
template<typename TStorage >
TCount count (TStorage &) const
void swap (DefaultCounter &other)

Private Attributes

TCountcount_


Detailed Description

The default counter for the shared pointers, implementation of CounterPolicy concept.

Author:
Bram de Greve [Bramz]
The default counter will use an self-owned integer as counter object. It will allocate this on the heap and share it between all smart pointers that own the same pointee (duh!). Of course it will be so nice to clean it up by itself too.

Definition at line 310 of file smart_ptr_policies.h.


Member Typedef Documentation

Definition at line 314 of file smart_ptr_policies.h.


Constructor & Destructor Documentation

lass::util::DefaultCounter::DefaultCounter (  )  [inline, protected]

Definition at line 318 of file smart_ptr_policies.h.


Member Function Documentation

template<typename TStorage >
void lass::util::DefaultCounter::init ( TStorage &   )  [inline, protected]

Definition at line 320 of file smart_ptr_policies.h.

References count_, lass::util::impl::initHeapCounter(), and LASS_ASSERT.

template<typename TStorage >
void lass::util::DefaultCounter::dispose ( TStorage &   )  [inline, protected]

Definition at line 326 of file smart_ptr_policies.h.

References count_, lass::util::impl::disposeHeapCounter(), and LASS_ASSERT.

template<typename TStorage >
void lass::util::DefaultCounter::increment ( TStorage &   )  [inline, protected]

Definition at line 332 of file smart_ptr_policies.h.

References lass::util::atomicCompareAndSwap(), count_, and LASS_ASSERT.

template<typename TStorage >
bool lass::util::DefaultCounter::decrement ( TStorage &   )  [inline, protected]

Definition at line 345 of file smart_ptr_policies.h.

References lass::util::atomicCompareAndSwap(), count_, and LASS_ASSERT.

template<typename TStorage >
TCount lass::util::DefaultCounter::count ( TStorage &   )  const [inline, protected]

Definition at line 359 of file smart_ptr_policies.h.

References count_, and LASS_ASSERT.

void lass::util::DefaultCounter::swap ( DefaultCounter other  )  [inline, protected]

Definition at line 365 of file smart_ptr_policies.h.

References count_.


Field Documentation

Definition at line 369 of file smart_ptr_policies.h.

Referenced by count(), decrement(), dispose(), increment(), init(), and swap().


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

Generated on Mon Nov 10 14:22:17 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo