TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
rcScopedDelete< T > Class Template Reference

#include <RecastAlloc.h>

Public Member Functions

 rcScopedDelete ()
 Constructs an instance with a null pointer. More...
 
 rcScopedDelete (T *p)
 
 ~rcScopedDelete ()
 
 operator T * ()
 

Private Member Functions

T * operator= (T *p)
 

Private Attributes

T * ptr
 

Detailed Description

template<class T>
class rcScopedDelete< T >

A simple helper class used to delete an array when it goes out of scope.

Note
This class is rarely if ever used by the end user.

Constructor & Destructor Documentation

template<class T>
rcScopedDelete< T >::rcScopedDelete ( )
inline

Constructs an instance with a null pointer.

112 : ptr(0) {}
T * ptr
Definition: RecastAlloc.h:107
template<class T>
rcScopedDelete< T >::rcScopedDelete ( T *  p)
inline

Constructs an instance with the specified pointer.

Parameters
[in]pAn pointer to an allocated array.
116 : ptr(p) {}
T * ptr
Definition: RecastAlloc.h:107
template<class T>
rcScopedDelete< T >::~rcScopedDelete ( )
inline
117 { rcFree(ptr); }
T * ptr
Definition: RecastAlloc.h:107
void rcFree(void *ptr)
Definition: RecastAlloc.cpp:55

+ Here is the call graph for this function:

Member Function Documentation

template<class T>
rcScopedDelete< T >::operator T * ( )
inline

The root array pointer.

Returns
The root array pointer.
121 { return ptr; }
T * ptr
Definition: RecastAlloc.h:107
template<class T>
T* rcScopedDelete< T >::operator= ( T *  p)
inlineprivate

Member Data Documentation

template<class T>
T* rcScopedDelete< T >::ptr
private

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