AutoPtr< Type > Class Template Reference


Detailed Description

template<typename Type>
class MaxSDK::Util::AutoPtr< Type >

Old AutoPtr class, maintained to support backwards compatibility.

The old single-pointer AutoPtr was removed from the Util namespace, and has been replaced with MaxSDK::AutoPtr<Type> using its default destruction policy template parameter.

#include <autoptr.h>

Inheritance diagram for AutoPtr< Type >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  AutoPtr (Type *p=NULL)
  Construct, assuming ownership of the pointed-to object.
  AutoPtr (const AutoPtrRef< Type > &ref)
  Construct from an AutoPtrRef.
template<typename OtherType >
  operator AutoPtr< OtherType > ()
  Destructive copy-convert allowing for cast of the pointer type.

Constructor & Destructor Documentation

AutoPtr ( Type *  p = NULL ) [inline, explicit]

Construct, assuming ownership of the pointed-to object.

Parameters:
p Plain pointer to an object - this AutoPtr will assume ownership of that object.

Reimplemented from AutoPtr< Type >.

AutoPtr ( 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:
ref helper object.

Reimplemented from AutoPtr< Type >.

                                         :
        MaxSDK::AutoPtr<Type>(ref.mPtr)
    { }

Member Function Documentation

operator AutoPtr< OtherType > ( ) [inline]

Destructive copy-convert allowing for cast of the pointer type.

    {
        return AutoPtr<OtherType>(this->Release());
    }