IT_AutoPtr< T > Class Template Reference

#include <it_cal/auto_ptr.h>

Inheritance diagram for IT_AutoPtr< T >:

IT_Bus::NillablePtr< T > IT_Reflect::ReflectedNillablePtr< T > List of all members.

Detailed Description

template<class T>
class IT_AutoPtr< T >

Smart pointer to a non-reference counted object.

The template class IT_Bus::Var<T>, described in it_bus/var.h, is a smart pointer for reference counted objects.

Definition at line 49 of file auto_ptr.h.

Public Member Functions

IT_EXPLICIT IT_AutoPtr (T *ptr=0) IT_THROW_DECL(())
 Constructor.
 IT_AutoPtr (const IT_AutoPtr< T > &other) IT_THROW_DECL(())
 Constructor.
 ~IT_AutoPtr () IT_THROW_DECL(())
 Destructor.
IT_AutoPtr< T > & operator= (const IT_AutoPtr< T > &rhs) IT_THROW_DECL(())
 Assignment operator.
T & operator * () const IT_THROW_DECL(())
 Dereferencing operator.
T * operator-> () const IT_THROW_DECL(())
 Pointer operator.
T * get () const IT_THROW_DECL(())
 Get the pointer but do not give up ownership.
T * release () IT_THROW_DECL(())
 Release the reference, giving up responsibility for memory management to the caller.
void reset (T *ptr=0) IT_THROW_DECL(())
 Set the internal pointer to a different object and release the memory used by the current object.

Private Attributes

T * m_ptr


Constructor & Destructor Documentation

template<class T>
IT_EXPLICIT IT_AutoPtr< T >::IT_AutoPtr ( T *  ptr = 0  )  [inline]

Constructor.

Parameters:
A pointer to the object.

Definition at line 59 of file auto_ptr.h.

template<class T>
IT_AutoPtr< T >::IT_AutoPtr ( const IT_AutoPtr< T > &  other  )  [inline]

Constructor.

Parameters:
A reference to another IT_AutoPtr instance.

Definition at line 70 of file auto_ptr.h.


Member Function Documentation

template<class T>
IT_AutoPtr<T>& IT_AutoPtr< T >::operator= ( const IT_AutoPtr< T > &  rhs  )  [inline]

Assignment operator.

Parameters:
A reference to an IT_AutoPtr instance.
Returns:
A reference to the IT_AutoPtr instance.

Definition at line 93 of file auto_ptr.h.

template<class T>
T& IT_AutoPtr< T >::operator * (  )  const [inline]

Dereferencing operator.

Returns:
A reference to the object.

Definition at line 107 of file auto_ptr.h.

template<class T>
T* IT_AutoPtr< T >::operator-> (  )  const [inline]

Pointer operator.

Returns:
A pointer to the object.

Definition at line 118 of file auto_ptr.h.

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

Get the pointer but do not give up ownership.

Returns:
A pointer to the object.

Definition at line 129 of file auto_ptr.h.

Referenced by IT_Bus::NillablePtr< T >::is_nil(), IT_Bus::NillablePtr< T >::operator=(), and IT_Bus::NillablePtr< T >::set().

template<class T>
T* IT_AutoPtr< T >::release (  )  [inline]

Release the reference, giving up responsibility for memory management to the caller.

Set internal pointer to 0 since it no longer points to a valid reference.

Returns:
A pointer to the object.

Definition at line 142 of file auto_ptr.h.

Referenced by IT_AutoPtr< ServiceHelper >::operator=().

template<class T>
void IT_AutoPtr< T >::reset ( T *  ptr = 0  )  [inline]

Set the internal pointer to a different object and release the memory used by the current object.

Parameters:
A pointer to the new object.

Definition at line 156 of file auto_ptr.h.

Referenced by IT_AutoPtr< ServiceHelper >::operator=(), IT_Bus::NillablePtr< T >::operator=(), IT_Bus::NillablePtr< T >::set(), and IT_Bus::NillablePtr< T >::set_nil().


Generated on Tue Mar 20 15:27:56 2007 for Artix by  doxygen 1.5.1-p1