B2BITS FIX Antenna HFT  1.0.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Utils::AutoPtr2< T, RELEASE_FUNC > Class Template Reference

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

#include <AutoPtr2.h>

Public Member Functions

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

Detailed Description

template<typename T, void(*)(T const *obj) RELEASE_FUNC>
class Utils::AutoPtr2< T, RELEASE_FUNC >

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

Constructor & Destructor Documentation

template<typename T, void(*)(T const *obj) RELEASE_FUNC>
Utils::AutoPtr2< T, RELEASE_FUNC >::AutoPtr2 ( )
throw (
)
inline

Default constructor.

template<typename T, void(*)(T const *obj) RELEASE_FUNC>
Utils::AutoPtr2< T, RELEASE_FUNC >::AutoPtr2 ( T *  ptr)
throw (
)
inlineexplicit

Constructor.

Parameters
ptrPointer to the object to be owned.
template<typename T, void(*)(T const *obj) RELEASE_FUNC>
Utils::AutoPtr2< T, RELEASE_FUNC >::AutoPtr2 ( AutoPtr2< T, RELEASE_FUNC > const &  ptr)
throw (
)
inline

Copy constructor.

References Utils::AutoPtr2< T, RELEASE_FUNC >::reset().

template<typename T, void(*)(T const *obj) RELEASE_FUNC>
Utils::AutoPtr2< T, RELEASE_FUNC >::~AutoPtr2 ( )
throw (
)
inline

Destructor.

Member Function Documentation

template<typename T, void(*)(T const *obj) RELEASE_FUNC>
T* Utils::AutoPtr2< T, RELEASE_FUNC >::get ( ) const
throw (
)
inline

Returns a pointer.

Returns
Pointer.
template<typename T, void(*)(T const *obj) RELEASE_FUNC>
T* Utils::AutoPtr2< T, RELEASE_FUNC >::get ( )
throw (
)
inline

Returns a pointer.

Returns
Pointer.
template<typename T, void(*)(T const *obj) RELEASE_FUNC>
T& Utils::AutoPtr2< T, RELEASE_FUNC >::operator* ( )
throw (
)
inline

Overloaded operator*.

template<typename T, void(*)(T const *obj) RELEASE_FUNC>
T& Utils::AutoPtr2< T, RELEASE_FUNC >::operator* ( ) const
throw (
)
inline

Overloaded operator*.

template<typename T, void(*)(T const *obj) RELEASE_FUNC>
T* Utils::AutoPtr2< T, RELEASE_FUNC >::operator-> ( )
throw (
)
inline

Overloaded operator->.

template<typename T, void(*)(T const *obj) RELEASE_FUNC>
T* Utils::AutoPtr2< T, RELEASE_FUNC >::operator-> ( ) const
throw (
)
inline

Overloaded operator->.

template<typename T, void(*)(T const *obj) RELEASE_FUNC>
AutoPtr2& Utils::AutoPtr2< T, RELEASE_FUNC >::operator= ( AutoPtr2< T, RELEASE_FUNC > const &  ptr)
throw (
)
inline

Copy operator.

References Utils::AutoPtr2< T, RELEASE_FUNC >::reset().

template<typename T, void(*)(T const *obj) RELEASE_FUNC>
T* Utils::AutoPtr2< T, RELEASE_FUNC >::release ( )
throw (
)
inline

Release underlying pointer and return it.

Returns
underlying pointer.
template<typename T, void(*)(T const *obj) RELEASE_FUNC>
void Utils::AutoPtr2< T, RELEASE_FUNC >::reset ( T *  ptr = NULL)
throw (
)
inline

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

Parameters
ptrNew value to set.

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