Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RefCount Class Template Reference

Reference counted object template. More...

#include <RefCount.h>

Inheritance diagram for RefCount:

Inheritance graph
[legend]
Collaboration diagram for RefCount:

Collaboration graph
[legend]
List of all members.

Public Methods

 RefCount (T s)
 Constructor a new refcounted T instance.

 RefCount (T *s=0)
 Refcounts the given pointer (Default).

 RefCount (const RefCount &s)
 Copy contructor, increases the reference count.

 ~RefCount ()
 Destrutor. More...

RefCount copy ()
 Makes a copy of impl and returns a new reference count.

void swap (RefCount &s)
 Swaps imp and count pointers from this and s.

RefCount & operator= (const RefCount &s)
 Normal assignment operator.

template<typename S> RefCount & operator= (const RefCount< S > &s)
 Polymorphic assignment operator template.

RefCount & operator= (T *s)
 Assignment operator. More...

T * operator-> ()
 Returns the pointer to impl.

T * data () const
 Returns the pointer to impl. More...

unsigned int * getCount () const
 Returns the count. More...


Detailed Description

template<typename T>
class RefCount< T >

Reference counted object template.


Constructor & Destructor Documentation

template<typename T>
RefCount< T >::~RefCount   [inline]
 

Destrutor.

Decreases the reference count and deletes impl if the count reaches 0.


Member Function Documentation

template<typename T>
T* RefCount< T >::data   const [inline]
 

Returns the pointer to impl.

Note:
For internal use only!

template<typename T>
unsigned int* RefCount< T >::getCount   const [inline]
 

Returns the count.

Note:
For internal use only!

template<typename T>
RefCount& RefCount< T >::operator= T *    s [inline]
 

Assignment operator.

RefCount takes ownership of s.


The documentation for this class was generated from the following file:
This documentation was generated using doxygen. If you have any comments or additions please mail me.