FreePOOMA  2.4.1
Public Types | Public Member Functions | Friends
RefCountedPtr< T > Class Template Reference

RefCountedPtr<T> is a smart-pointer class that provides reference counting for objects of type T. More...

#include <RefCountedPtr.h>

Inheritance diagram for RefCountedPtr< T >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef RefCountedPtr< T > This_t
typedef T Pointee_t

Public Member Functions

 RefCountedPtr ()
 RefCountedPtr (T *const pT)
 RefCountedPtr (const This_t &model)
 ~RefCountedPtr ()
 ~RefCountedPtr Destructor.
RefCountedPtroperator= (const RefCountedPtr &)
 RefCountedPtr<T>& operator=(const RefCountedPtr<T>& rhs) Assignment of RefCountedPtr<T>
RefCountedPtroperator= (T *)
 RefCountedPtr<T>& operator=(T *pp) Assignment of pointer to T to a RefCountedPtr<T>.
T * operator-> () const
T & operator* () const
bool operator== (const This_t &a) const
bool operator!= (const This_t &a) const
void invalidate ()
 void invalidate() Delete reference and set pointer field to NULL
bool isValid () const
bool isShared () const
int count () const
RefCountedPtr< T > & makeOwnCopy ()
 RefCountedPtr<T>& makeOwnCopy() If we aren't the sole owner of the data, make a private copy.
T * rawPointer ()
const T * rawPointer () const

Friends

class RefCountedBlockPtr

Detailed Description

template<class T>
class RefCountedPtr< T >

RefCountedPtr<T> is a smart-pointer class that provides reference counting for objects of type T.

T must provide the same interface and semantics as RefCounted, which is usually accomplished by inheriting from RefCounted.


Member Typedef Documentation

template<class T>
typedef RefCountedPtr<T> RefCountedPtr< T >::This_t
template<class T>
typedef T RefCountedPtr< T >::Pointee_t

Constructor & Destructor Documentation

template<class T>
RefCountedPtr< T >::RefCountedPtr ( ) [inline]
template<class T>
RefCountedPtr< T >::RefCountedPtr ( T *const  pT) [inline]
template<class T>
RefCountedPtr< T >::RefCountedPtr ( const This_t model) [inline]
template<class T >
RefCountedPtr< T >::~RefCountedPtr ( ) [inline]

~RefCountedPtr Destructor.

Work done by invalidate().

References RefCountedBlockPtr< T, BoundsChecked, Controller >::invalidate().


Member Function Documentation

template<class T >
RefCountedPtr< T > & RefCountedPtr< T >::operator= ( const RefCountedPtr< T > &  rhs) [inline]
template<class T>
RefCountedPtr< T > & RefCountedPtr< T >::operator= ( T *  pp) [inline]

RefCountedPtr<T>& operator=(T *pp) Assignment of pointer to T to a RefCountedPtr<T>.

References RefCountedBlockPtr< T, BoundsChecked, Controller >::isValid().

template<class T>
T* RefCountedPtr< T >::operator-> ( ) const [inline]
template<class T>
T& RefCountedPtr< T >::operator* ( ) const [inline]
template<class T>
bool RefCountedPtr< T >::operator== ( const This_t a) const [inline]
template<class T>
bool RefCountedPtr< T >::operator!= ( const This_t a) const [inline]
template<class T >
void RefCountedPtr< T >::invalidate ( ) [inline]
template<class T>
bool RefCountedPtr< T >::isValid ( ) const [inline]
template<class T>
bool RefCountedPtr< T >::isShared ( ) const [inline]
template<class T>
int RefCountedPtr< T >::count ( ) const [inline]
template<class T >
RefCountedPtr< T > & RefCountedPtr< T >::makeOwnCopy ( ) [inline]

RefCountedPtr<T>& makeOwnCopy() If we aren't the sole owner of the data, make a private copy.

Returns itself for use in chained expressions.

References ElementProperties< T >::clone(), and RefCountedBlockPtr< T, BoundsChecked, Controller >::isValid().

Referenced by CompressibleBlock< T >::makeOwnCopy(), and RefCountedBlockPtr< Element_t >::makeOwnCopy().

template<class T>
T* RefCountedPtr< T >::rawPointer ( ) [inline]
template<class T>
const T* RefCountedPtr< T >::rawPointer ( ) const [inline]

Friends And Related Function Documentation

template<class T>
friend class RefCountedBlockPtr [friend]

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