GNU CommonC++
ost::Pointer< T > Class Template Reference

Used to create and manage referece counted pointers. More...

#include <pointer.h>

Public Member Functions

 Pointer (T *ptr=NULL)
 
 Pointer (const Pointer< T > &ref)
 
virtual ~Pointer ()
 
Pointeroperator= (const Pointer< T > &ref)
 
T & operator* () const
 
T * getObject () const
 
T * operator-> () const
 
bool operator! () const
 
int operator++ () const
 
int operator-- () const
 

Protected Member Functions

void ptrDetach (void)
 

Protected Attributes

unsigned * ptrCount
 
T * ptrObject
 

Detailed Description

template<class T>
class ost::Pointer< T >

Used to create and manage referece counted pointers.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

reference counted pointer template.

Constructor & Destructor Documentation

◆ Pointer() [1/2]

template<class T>
ost::Pointer< T >::Pointer ( T * ptr = NULL)
inlineexplicit

References ptrCount, and ptrObject.

Referenced by operator=(), and Pointer().

◆ Pointer() [2/2]

template<class T>
ost::Pointer< T >::Pointer ( const Pointer< T > & ref)
inline

References Pointer(), ptrCount, and ptrObject.

◆ ~Pointer()

template<class T>
virtual ost::Pointer< T >::~Pointer ( )
inlinevirtual

References ptrDetach().

Member Function Documentation

◆ getObject()

template<class T>
T * ost::Pointer< T >::getObject ( ) const
inline

References ptrObject.

◆ operator!()

template<class T>
bool ost::Pointer< T >::operator! ( ) const
inline

References ptrCount.

◆ operator*()

template<class T>
T & ost::Pointer< T >::operator* ( ) const
inline

References ptrObject.

◆ operator++()

template<class T>
int ost::Pointer< T >::operator++ ( ) const
inline

◆ operator--()

template<class T>
int ost::Pointer< T >::operator-- ( ) const
inline

References ptrCount.

◆ operator->()

template<class T>
T * ost::Pointer< T >::operator-> ( ) const
inline

References ptrObject.

◆ operator=()

template<class T>
Pointer & ost::Pointer< T >::operator= ( const Pointer< T > & ref)
inline

◆ ptrDetach()

template<class T>
void ost::Pointer< T >::ptrDetach ( void )
inlineprotected

References ptrCount, and ptrObject.

Referenced by operator=(), and ~Pointer().

Member Data Documentation

◆ ptrCount

template<class T>
unsigned* ost::Pointer< T >::ptrCount
protected

◆ ptrObject

template<class T>
T* ost::Pointer< T >::ptrObject
protected

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