B2BITS FIX Antenna HFT  1.0.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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. More...
 

Public Member Functions

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

Detailed Description

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

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

Member Typedef Documentation

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

Declares ReleaseMethod handler.

Constructor & Destructor Documentation

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

Default constructor.

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.
template<typename T>
Utils::AutoPtr< T >::AutoPtr ( AutoPtr< T > &  ptr)
throw (
)
inline

Copy constructor.

References Utils::AutoPtr< T >::reset().

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

Destructor.

Member Function Documentation

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

Returns a pointer.

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

Returns a pointer.

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

Overloaded operator&.

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

Overloaded operator*.

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

Overloaded operator*.

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

Overloaded operator->.

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

Overloaded operator->.

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

Copy operator.

References Utils::AutoPtr< T >::reset().

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

Release underlying pointer and return it.

Returns
underlying pointer.
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.

Referenced by Utils::AutoPtr< T >::AutoPtr(), and Utils::AutoPtr< T >::operator=().