B2BITS FIX Antenna C++ 2.33.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Utils::AutoPtr< T > Class Template Reference

std::auto_ptr analogue with ability to delete object by object's method. More...

#include <B2BITS_AutoPtr.h>

Public Types

typedef ConstMethodResolver< T >::MethodType ReleaseMethod
 Declares ReleaseMethod handler.
 

Public Member Functions

 AutoPtr () throw ()
 Default constructor.
 
 AutoPtr (AutoPtr< T > &ptr) throw ()
 Copy constructor.
 
 AutoPtr (T *ptr, ReleaseMethod releaseMethod) throw ()
 Constructor.
 
T * get () throw ()
 Returns a pointer.
 
T const * get () const throw ()
 Returns a pointer.
 
T ** operator& ()
 Overloaded operator&.
 
T & operator* () throw ()
 Overloaded operator*.
 
T const & operator* () const throw ()
 Overloaded operator*.
 
T * operator-> () throw ()
 Overloaded operator->.
 
T const * operator-> () const throw ()
 Overloaded operator->.
 
AutoPtroperator= (AutoPtr< T > &ptr) throw ()
 Copy operator.
 
T * release () throw ()
 Release underlying pointer and return it.
 
void reset (T *ptr, ReleaseMethod releaseMethod) throw ()
 Deletes object by underlying pointer and set it to new value.
 
 ~AutoPtr () throw ()
 Destructor.
 

Detailed Description

template<typename T>
class Utils::AutoPtr< T >

std::auto_ptr analogue with ability to delete object by object's method.

Deprecated
This class is not safe. Please use Utils::AutoPtr2 instead.

Member Typedef Documentation

◆ ReleaseMethod

template<typename T >
typedef ConstMethodResolver<T>::MethodType Utils::AutoPtr< T >::ReleaseMethod

Declares ReleaseMethod handler.

Constructor & Destructor Documentation

◆ AutoPtr() [1/3]

template<typename T >
Utils::AutoPtr< T >::AutoPtr ( )
throw ( )
inline

Default constructor.

◆ AutoPtr() [2/3]

template<typename T >
Utils::AutoPtr< T >::AutoPtr ( T * ptr,
ReleaseMethod releaseMethod )
throw ( )
inline

Constructor.

Parameters
ptrPointer to the object to be owned.
releaseMethodObject's release method.

◆ AutoPtr() [3/3]

template<typename T >
Utils::AutoPtr< T >::AutoPtr ( AutoPtr< T > & ptr)
throw ( )
inline

Copy constructor.

◆ ~AutoPtr()

template<typename T >
Utils::AutoPtr< T >::~AutoPtr ( )
throw ( )
inline

Destructor.

Member Function Documentation

◆ get() [1/2]

template<typename T >
T * Utils::AutoPtr< T >::get ( )
throw ( )
inline

Returns a pointer.

Returns
Pointer.

◆ get() [2/2]

template<typename T >
T const * Utils::AutoPtr< T >::get ( ) const
throw ( )
inline

Returns a pointer.

Returns
Pointer.

◆ operator&()

template<typename T >
T ** Utils::AutoPtr< T >::operator& ( )
inline

Overloaded operator&.

◆ operator*() [1/2]

template<typename T >
T & Utils::AutoPtr< T >::operator* ( )
throw ( )
inline

Overloaded operator*.

◆ operator*() [2/2]

template<typename T >
T const & Utils::AutoPtr< T >::operator* ( ) const
throw ( )
inline

Overloaded operator*.

◆ operator->() [1/2]

template<typename T >
T * Utils::AutoPtr< T >::operator-> ( )
throw ( )
inline

Overloaded operator->.

◆ operator->() [2/2]

template<typename T >
T const * Utils::AutoPtr< T >::operator-> ( ) const
throw ( )
inline

Overloaded operator->.

◆ operator=()

template<typename T >
AutoPtr & Utils::AutoPtr< T >::operator= ( AutoPtr< T > & ptr)
throw ( )
inline

Copy operator.

◆ release()

template<typename T >
T * Utils::AutoPtr< T >::release ( )
throw ( )
inline

Release underlying pointer and return it.

Returns
underlying pointer.

◆ reset()

template<typename T >
void Utils::AutoPtr< T >::reset ( T * ptr,
ReleaseMethod releaseMethod )
throw ( )
inline

Deletes object by underlying pointer and set it to new value.

Parameters
ptrNew value to set.
releaseMethodObject's release method.