Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Private Member Functions | Private Attributes
nsAutoArrayPtr< T > Class Template Reference

#include <nsAutoPtr.h>

Inheritance diagram for nsAutoArrayPtr< T >:
Inheritance graph
[legend]
Collaboration diagram for nsAutoArrayPtr< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef T element_type

Public Member Functions

 ~nsAutoArrayPtr ()
 nsAutoArrayPtr ()
 nsAutoArrayPtr (T *aRawPtr)
 nsAutoArrayPtr (nsAutoArrayPtr< T > &aSmartPtr)
nsAutoArrayPtr< T > & operator= (T *rhs)
nsAutoArrayPtr< T > & operator= (nsAutoArrayPtr< T > &rhs)
Tget () const
 operator T * () const
Tforget ()
Toperator-> () const
nsAutoArrayPtr< T > * get_address ()
const nsAutoArrayPtr< T > * get_address () const
Toperator* () const
T ** StartAssignment ()

Private Member Functions

void ** begin_assignment ()
void assign (T *newPtr)

Private Attributes

TmRawPtr

Detailed Description

template<class T>
class nsAutoArrayPtr< T >

Definition at line 498 of file nsAutoPtr.h.


Member Typedef Documentation

template<class T>
typedef T nsAutoArrayPtr< T >::element_type

Definition at line 520 of file nsAutoPtr.h.


Constructor & Destructor Documentation

template<class T>
nsAutoArrayPtr< T >::~nsAutoArrayPtr ( ) [inline]

Definition at line 522 of file nsAutoPtr.h.

        {
          delete [] mRawPtr;
        }
template<class T>
nsAutoArrayPtr< T >::nsAutoArrayPtr ( ) [inline]

Definition at line 529 of file nsAutoPtr.h.

            : mRawPtr(0)
          // default constructor
        {
        }
template<class T>
nsAutoArrayPtr< T >::nsAutoArrayPtr ( T aRawPtr) [inline]

Definition at line 535 of file nsAutoPtr.h.

            : mRawPtr(aRawPtr)
          // construct from a raw pointer (of the right type)
        {
        }
template<class T>
nsAutoArrayPtr< T >::nsAutoArrayPtr ( nsAutoArrayPtr< T > &  aSmartPtr) [inline]

Definition at line 541 of file nsAutoPtr.h.

            : mRawPtr( aSmartPtr.forget() )
          // Construct by transferring ownership from another smart pointer.
        {
        }

Member Function Documentation

template<class T>
void nsAutoArrayPtr< T >::assign ( T newPtr) [inline, private]

Definition at line 509 of file nsAutoPtr.h.

        {
          T* oldPtr = mRawPtr;
          mRawPtr = newPtr;
          delete [] oldPtr;
        }

Here is the caller graph for this function:

template<class T>
void** nsAutoArrayPtr< T >::begin_assignment ( ) [inline, private]

Definition at line 502 of file nsAutoPtr.h.

        {
          assign(0);
          return NS_REINTERPRET_CAST(void**, &mRawPtr);
        }

Here is the caller graph for this function:

template<class T>
T* nsAutoArrayPtr< T >::forget ( ) [inline]

Definition at line 593 of file nsAutoPtr.h.

        {
          T* temp = mRawPtr;
          mRawPtr = 0;
          return temp;
        }

Here is the caller graph for this function:

template<class T>
T* nsAutoArrayPtr< T >::get ( ) const [inline]

Definition at line 568 of file nsAutoPtr.h.

        {
          return mRawPtr;
        }

Here is the caller graph for this function:

template<class T>
nsAutoArrayPtr<T>* nsAutoArrayPtr< T >::get_address ( ) [inline]

Definition at line 621 of file nsAutoPtr.h.

        {
          return this;
        }

Here is the caller graph for this function:

template<class T>
const nsAutoArrayPtr<T>* nsAutoArrayPtr< T >::get_address ( ) const [inline]

Definition at line 629 of file nsAutoPtr.h.

        {
          return this;
        }
template<class T>
nsAutoArrayPtr< T >::operator T * ( ) const [inline]

Definition at line 578 of file nsAutoPtr.h.

        {
          return get();
        }
template<class T>
T& nsAutoArrayPtr< T >::operator* ( ) const [inline]

Definition at line 640 of file nsAutoPtr.h.

        {
          NS_PRECONDITION(mRawPtr != 0, "You can't dereference a NULL nsAutoArrayPtr with operator*().");
          return *get();
        }
template<class T>
T* nsAutoArrayPtr< T >::operator-> ( void  ) const [inline]

Definition at line 601 of file nsAutoPtr.h.

        {
          NS_PRECONDITION(mRawPtr != 0, "You can't dereference a NULL nsAutoArrayPtr with operator->().");
          return get();
        }
template<class T>
nsAutoArrayPtr<T>& nsAutoArrayPtr< T >::operator= ( T rhs) [inline]

Definition at line 551 of file nsAutoPtr.h.

        {
          assign(rhs);
          return *this;
        }
template<class T>
nsAutoArrayPtr<T>& nsAutoArrayPtr< T >::operator= ( nsAutoArrayPtr< T > &  rhs) [inline]

Definition at line 558 of file nsAutoPtr.h.

        {
          assign(rhs.forget());
          return *this;
        }
template<class T>
T** nsAutoArrayPtr< T >::StartAssignment ( ) [inline]

Definition at line 647 of file nsAutoPtr.h.

        {
#ifndef NSCAP_FEATURE_INLINE_STARTASSIGNMENT
          return NS_REINTERPRET_CAST(T**, begin_assignment());
#else
          assign(0);
          return NS_REINTERPRET_CAST(T**, &mRawPtr);
#endif
        }

Member Data Documentation

template<class T>
T* nsAutoArrayPtr< T >::mRawPtr [private]

Definition at line 517 of file nsAutoPtr.h.


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