You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
812 B
52 lines
812 B
/*++
|
|
|
|
Copyright (C) 1996-1999 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
SMARTPTR.H
|
|
|
|
History:
|
|
|
|
--*/
|
|
|
|
|
|
#ifndef ESPUTIL_SMARTPTR_H
|
|
#define ESPUTIL_SMARTPTR_H
|
|
|
|
|
|
|
|
template<class T>
|
|
class SmartPtr
|
|
{
|
|
public:
|
|
NOTHROW SmartPtr();
|
|
NOTHROW SmartPtr(T *);
|
|
|
|
NOTHROW T & operator*(void) const;
|
|
NOTHROW T * operator->(void) const;
|
|
NOTHROW T* Extract(void);
|
|
NOTHROW T* GetPointer(void);
|
|
NOTHROW const T * GetPointer(void) const;
|
|
NOTHROW BOOL IsNull(void) const;
|
|
|
|
void operator=(T *);
|
|
operator T* &(void);
|
|
|
|
NOTHROW ~SmartPtr();
|
|
|
|
private:
|
|
T *m_pObject;
|
|
|
|
SmartPtr(const SmartPtr<T> &);
|
|
void operator=(const SmartPtr<T> &);
|
|
|
|
//
|
|
// This hackery prevents Smart Pointer from being on the heap
|
|
//
|
|
void operator delete(void *);
|
|
};
|
|
|
|
#include "smartptr.inl"
|
|
|
|
#endif
|