Humble Framework for SkyOS


Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

HPtr< T > Class Template Reference
[Base]

#include <HPtr.h>


Detailed Description

template<class T>
class HPtr< T >

The HPtr template class is based on code published in section 6.8 of The C++ Standard Library by Nicolai Josuttis. It should only be used for ptrs allocated using the new function, as the ptr is auto- matically deleted when the last reference is removed.

Definition at line 28 of file HPtr.h.

Public Member Functions

uint32 GetRefCount (void) const
 Returns the current reference count.
bool IsNotValid (void) const
 Evaluates to true if the pointer is invalid.
bool IsValid (void) const
 Evaluates to true if the pointer is valid.
HPtr< T > & operator= (const HPtr< T > &rhs) throw ()
T & operator * () const throw ()
T * operator-> () const throw ()
 HPtr (T *p=NULL)
 HPtr (const HPtr< T > &p) throw ()

Protected Member Functions

void addRef (void)
 Increments the reference count.
void delRef (void)
 Decrements the reference count, deleting the ptr if it reaches zero.

Protected Attributes

T * m_pT
 ptr to the actual data
uint32 * m_puRefs
 ptr to the reference m_puRefs


Member Function Documentation

template<class T>
uint32 HPtr< T >::GetRefCount void   )  const
 

Returns:
Count of references

Definition at line 71 of file HPtr.h.

template<class T>
bool HPtr< T >::IsNotValid void   )  const
 

Returns:
True if a NULL pointer, false otherwise

Definition at line 79 of file HPtr.h.

template<class T>
bool HPtr< T >::IsValid void   )  const
 

Returns:
True if a valid (non-NULL) pointer, false otherwise

Definition at line 87 of file HPtr.h.


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

2006.01.09-16:37