The Pedigree Project 0.1
Public Member Functions | Private Attributes | List of all members
PointerGuard< T > Class Template Reference

#include <PointerGuard.h>

+ Collaboration diagram for PointerGuard< T >:

Public Member Functions

 PointerGuard (T *p=0, bool bArray=false)
 
 PointerGuard (T **p=0, bool bArray=false)
 
 PointerGuard (PointerGuard< T > &p)
 
PointerGuard< T > & operator= (PointerGuard< T > &p)
 

Private Attributes

T * m_Pointer
 
T ** m_Wrapper
 
bool m_Array
 

Detailed Description

template<class T>
class PointerGuard< T >

Provides a guard for a pointer. When the class goes out of scope the pointer will automatically be freed.

Definition at line 30 of file PointerGuard.h.

Constructor & Destructor Documentation

◆ PointerGuard() [1/3]

template<class T >
PointerGuard< T >::PointerGuard ( T *  p = 0,
bool  bArray = false 
)
inline

Definition at line 32 of file PointerGuard.h.

◆ PointerGuard() [2/3]

template<class T >
PointerGuard< T >::PointerGuard ( T **  p = 0,
bool  bArray = false 
)
inline

Definition at line 37 of file PointerGuard.h.

◆ ~PointerGuard()

template<class T >
virtual PointerGuard< T >::~PointerGuard ( )
inlinevirtual

Definition at line 42 of file PointerGuard.h.

◆ PointerGuard() [3/3]

template<class T >
PointerGuard< T >::PointerGuard ( PointerGuard< T > &  p)
inline

Neither of these should be used, as they defeat the purpose (and will cause a dual delete of the pointer)

Definition at line 62 of file PointerGuard.h.

Member Function Documentation

◆ operator=()

template<class T >
PointerGuard< T > & PointerGuard< T >::operator= ( PointerGuard< T > &  p)
inline

Definition at line 68 of file PointerGuard.h.

Member Data Documentation

◆ m_Array

template<class T >
bool PointerGuard< T >::m_Array
private

Definition at line 77 of file PointerGuard.h.

◆ m_Pointer

template<class T >
T* PointerGuard< T >::m_Pointer
private

Definition at line 75 of file PointerGuard.h.

◆ m_Wrapper

template<class T >
T** PointerGuard< T >::m_Wrapper
private

Definition at line 76 of file PointerGuard.h.


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