3ds Max C++ API Reference
DeleteThisAutoPtr< Type > Class Template Reference

Partial template specialization of AutoPtr for types requiring destruction through a DeleteThis method. More...

#include <autoptr.h>

+ Inheritance diagram for DeleteThisAutoPtr< Type >:

Public Member Functions

 DeleteThisAutoPtr (Type *p=NULL)
 Construct, assuming ownership of the pointed-to object. More...
 
 DeleteThisAutoPtr (const AutoPtrRef< Type > &ref)
 Construct from an AutoPtrRef. More...
 
- Public Member Functions inherited from AutoPtr< Type, DeleteThisDestructor >
 AutoPtr (Type *p=NULL)
 Construct, assuming ownership of the pointed-to object. More...
 
 AutoPtr (AutoPtr &a)
 Copy construct, assuming ownership from the source AutoPtr. More...
 
 AutoPtr (AutoPtr< OtherType, DeleteThisDestructor > &a)
 Conversion copy constructor. More...
 
 AutoPtr (const AutoPtrRef< Type > &ref)
 Construct from an AutoPtrRef. More...
 
 ~AutoPtr ()
 Destructor - automatically cleans up the pointed-to object. More...
 
AutoPtroperator= (const AutoPtr &a)
 Assignment, takes over ownership from the source AutoPtr. More...
 
AutoPtroperator= (AutoPtr< OtherType, DeleteThisDestructor > &a)
 Conversion assignment, takes over ownership of any type assignable to type from the source AutoPtr. More...
 
Type & operator* () const
 Dereferencing operator - works exactly like a plain pointer's operator*. More...
 
Type * operator-> () const
 Pointer-to-member dereferencing operator - works exactly like a plain pointer's operator->. More...
 
Type * Get () const
 Get the plain pointer back. More...
 
Type * Release ()
 Relinquish ownership of the pointed-to object to the caller. More...
 
void Reset (Type *p=NULL)
 Assume ownership of a new object, any existing pointer will be deleted. More...
 
bool IsNull () const
 Addition to the textbook interface. More...
 
 operator AutoPtrRef< OtherType > ()
 Convert to an AutoPtrRef. More...
 
 operator AutoPtr< OtherType, DeleteThisDestructor > ()
 Destructive copy-convert allowing for cast of the pointer type. More...
 

Additional Inherited Members

- Public Types inherited from AutoPtr< Type, DeleteThisDestructor >
typedef Type element_type
 Typedef to make the element type a member of the class. More...
 
typedef DeleteThisDestructor destructor
 Typedef to make the DestructionPolicy type a member of the class. More...
 

Detailed Description

template<typename Type>
class MaxSDK::DeleteThisAutoPtr< Type >

Partial template specialization of AutoPtr for types requiring destruction through a DeleteThis method.

Please refer to AutoPtr's documentation for more information about AutoPtrs.

Constructor & Destructor Documentation

◆ DeleteThisAutoPtr() [1/2]

DeleteThisAutoPtr ( Type *  p = NULL)
inlineexplicit

Construct, assuming ownership of the pointed-to object.

Parameters
pPlain pointer to an object - this AutoPtr will assume ownership of that object.
471  :
472  AutoPtr<Type, DeleteThisDestructor >(p)
473  { };

◆ DeleteThisAutoPtr() [2/2]

DeleteThisAutoPtr ( const AutoPtrRef< Type > &  ref)
inline

Construct from an AutoPtrRef.

This may be done implicitly or explicitly. The Ref object exists to avoid temporarily needing to have two AutoPtrs own the same object.

Parameters
refhelper object.
482  :
483  AutoPtr<Type, DeleteThisDestructor >(ref.mPtr)
484  { }