B2BITS FIX Antenna C++ 2.33.0
Loading...
Searching...
No Matches
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.
 
 AutoPtr2 (AutoPtr2< T, RELEASE_FUNC > const &ptr) throw ()
 Copy constructor.
 
 AutoPtr2 (T *ptr) throw ()
 Constructor.
 
T * get () throw ()
 Returns a pointer.
 
T * get () const throw ()
 Returns a pointer.
 
T & operator* () throw ()
 Overloaded operator*.
 
T & operator* () const throw ()
 Overloaded operator*.
 
T * operator-> () throw ()
 Overloaded operator->.
 
T * operator-> () const throw ()
 Overloaded operator->.
 
AutoPtr2operator= (AutoPtr2< T, RELEASE_FUNC > const &ptr) throw ()
 Copy operator.
 
T * release () throw ()
 Release underlying pointer and return it.
 
void reset (T *ptr=NULL) throw ()
 Deletes object by underlying pointer and set it to new value.
 
 ~AutoPtr2 () throw ()
 Destructor.
 

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 ( )
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 ( ) const
throw ( )
inline

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

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

◆ operator->() [2/2]

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

Overloaded operator->.

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

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