B2BITS FIX Antenna C++  2.27.1
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 <B2BITS_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

◆ AutoPtr2() [1/3]

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

Default constructor.

◆ AutoPtr2() [2/3]

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.

◆ AutoPtr2() [3/3]

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().

◆ ~AutoPtr2()

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

Destructor.

Member Function Documentation

◆ get() [1/2]

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

Returns a pointer.

Returns
Pointer.

◆ get() [2/2]

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

Returns a pointer.

Returns
Pointer.

◆ operator*() [1/2]

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

Overloaded operator*.

◆ operator*() [2/2]

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

Overloaded operator*.

◆ operator->() [1/2]

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

Overloaded operator->.

◆ operator->() [2/2]

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

Overloaded operator->.

◆ 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().

◆ release()

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.

◆ reset()

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=().