Rosetta Utilities  2014.35
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
utility::pointer::owning_ptr< T > Class Template Reference

Shared-ownership intrusive reference-counted smart pointer. More...

#include <owning_ptr.hh>

Public Types

typedefValue
 
typedef T & Reference
 
typedef T const & ConstReference
 
typedef T * Pointer
 
typedef T const * ConstPointer
 
typedefvalue_type
 
typedefelement_type
 
typedef T & reference
 
typedef T const & const_reference
 
typedef T * pointer
 
typedef T const * const_pointer
 

Public Member Functions

 owning_ptr ()
 Default constructor. More...
 
 owning_ptr (owning_ptr const &a)
 Copy constructor (implicit) More...
 
template<typename Assignable >
 owning_ptr (owning_ptr< Assignable > const &a)
 Assignable copy constructor (implicit) More...
 
 owning_ptr (pointer object_p)
 Object pointer constructor (implicit) More...
 
 owning_ptr (reference object)
 Object constructor. More...
 
 ~owning_ptr ()
 Destructor. More...
 
owning_ptroperator= (owning_ptr const &a)
 Copy assignment. More...
 
template<typename Assignable >
owning_ptroperator= (owning_ptr< Assignable > const &a)
 Assignable copy assignment. More...
 
owning_ptroperator= (pointer object_p)
 Object pointer assignment. More...
 
owning_ptroperator= (reference object)
 Object assignment. More...
 
 operator bool () const
 bool conversion: points to something? More...
 
reference operator* () const
 Dereference. More...
 
pointer operator-> () const
 Indirection. More...
 
pointer operator() () const
 Raw pointer. More...
 
pointer get () const
 Raw pointer. More...
 
bool operator! () const
 Points to nothing? (some compilers need this) More...
 
void reset_to_null ()
 Release ownership and reset. More...
 
void relinquish_ownership ()
 Release ownership but leave pointed memory alone. More...
 
void swap (owning_ptr &a)
 Swap. More...
 

Private Attributes

pointer p_
 Pointer to object. More...
 

Friends

template<typename >
class owning_ptr
 

Detailed Description

template<typename T>
class utility::pointer::owning_ptr< T >

Shared-ownership intrusive reference-counted smart pointer.

Member Typedef Documentation

template<typename T>
typedef T const* utility::pointer::owning_ptr< T >::const_pointer
template<typename T>
typedef T const& utility::pointer::owning_ptr< T >::const_reference
template<typename T>
typedef T const* utility::pointer::owning_ptr< T >::ConstPointer
template<typename T>
typedef T const& utility::pointer::owning_ptr< T >::ConstReference
template<typename T>
typedef T utility::pointer::owning_ptr< T >::element_type
template<typename T>
typedef T* utility::pointer::owning_ptr< T >::Pointer
template<typename T>
typedef T* utility::pointer::owning_ptr< T >::pointer
template<typename T>
typedef T& utility::pointer::owning_ptr< T >::Reference
template<typename T>
typedef T& utility::pointer::owning_ptr< T >::reference
template<typename T>
typedef T utility::pointer::owning_ptr< T >::Value
template<typename T>
typedef T utility::pointer::owning_ptr< T >::value_type

Constructor & Destructor Documentation

template<typename T>
utility::pointer::owning_ptr< T >::owning_ptr ( )
inline

Default constructor.

template<typename T>
utility::pointer::owning_ptr< T >::owning_ptr ( owning_ptr< T > const &  a)
inline

Copy constructor (implicit)

template<typename T>
template<typename Assignable >
utility::pointer::owning_ptr< T >::owning_ptr ( owning_ptr< Assignable > const &  a)
inline

Assignable copy constructor (implicit)

template<typename T>
utility::pointer::owning_ptr< T >::owning_ptr ( pointer  object_p)
inline

Object pointer constructor (implicit)

template<typename T>
utility::pointer::owning_ptr< T >::owning_ptr ( reference  object)
inlineexplicit

Object constructor.

template<typename T>
utility::pointer::owning_ptr< T >::~owning_ptr ( )
inline

Destructor.

Member Function Documentation

template<typename T>
pointer utility::pointer::owning_ptr< T >::get ( ) const
inline
template<typename T>
utility::pointer::owning_ptr< T >::operator bool ( ) const
inline

bool conversion: points to something?

Note
Enables unwanted conversions but work-around has compiler-dependencies
template<typename T>
bool utility::pointer::owning_ptr< T >::operator! ( ) const
inline

Points to nothing? (some compilers need this)

template<typename T>
pointer utility::pointer::owning_ptr< T >::operator() ( ) const
inline

Raw pointer.

template<typename T>
reference utility::pointer::owning_ptr< T >::operator* ( ) const
inline

Dereference.

template<typename T>
pointer utility::pointer::owning_ptr< T >::operator-> ( ) const
inline

Indirection.

template<typename T>
owning_ptr& utility::pointer::owning_ptr< T >::operator= ( owning_ptr< T > const &  a)
inline

Copy assignment.

template<typename T>
template<typename Assignable >
owning_ptr& utility::pointer::owning_ptr< T >::operator= ( owning_ptr< Assignable > const &  a)
inline

Assignable copy assignment.

template<typename T>
owning_ptr& utility::pointer::owning_ptr< T >::operator= ( pointer  object_p)
inline

Object pointer assignment.

template<typename T>
owning_ptr& utility::pointer::owning_ptr< T >::operator= ( reference  object)
inline

Object assignment.

template<typename T>
void utility::pointer::owning_ptr< T >::relinquish_ownership ( )
inline

Release ownership but leave pointed memory alone.

template<typename T>
void utility::pointer::owning_ptr< T >::reset_to_null ( )
inline

Release ownership and reset.

template<typename T>
void utility::pointer::owning_ptr< T >::swap ( owning_ptr< T > &  a)
inline

Swap.

Friends And Related Function Documentation

template<typename T>
template<typename >
friend class owning_ptr
friend

Member Data Documentation

template<typename T>
pointer utility::pointer::owning_ptr< T >::p_
private

The documentation for this class was generated from the following files: