GClasses
GClasses::ArrayHolder< T > Class Template Reference

Detailed Description

template<class T>
class GClasses::ArrayHolder< T >

Just like Holder, except for arrays.

#include <GHolders.h>

Public Member Functions

 ArrayHolder (T *p=NULL)
 
 ~ArrayHolder ()
 Deletes the array of objects being held. More...
 
T * get ()
 Returns a pointer to the first element of the array being held. More...
 
T & operator[] (size_t n)
 
T * release ()
 Releases the array. (After calling this method, it is your job to delete the array.) More...
 
void reset (T *p=NULL)
 Deletes the array of objects being held and sets this holder to hold NULL. More...
 

Constructor & Destructor Documentation

template<class T >
GClasses::ArrayHolder< T >::ArrayHolder ( T *  p = NULL)
inline
template<class T >
GClasses::ArrayHolder< T >::~ArrayHolder ( )
inline

Deletes the array of objects being held.

Member Function Documentation

template<class T >
T* GClasses::ArrayHolder< T >::get ( )
inline

Returns a pointer to the first element of the array being held.

template<class T >
T& GClasses::ArrayHolder< T >::operator[] ( size_t  n)
inline
template<class T >
T* GClasses::ArrayHolder< T >::release ( )
inline

Releases the array. (After calling this method, it is your job to delete the array.)

template<class T >
void GClasses::ArrayHolder< T >::reset ( T *  p = NULL)
inline

Deletes the array of objects being held and sets this holder to hold NULL.