mn::pointer::basic_linked_ptr< T > Class Template Reference

This class implements a basic_linked_ptr template that it allows sharing of pointers between instances via reference counting. basic_linked_ptr objects can safely be copied. More...

#include <mn_linked_ptr.hpp>

+ Inheritance diagram for mn::pointer::basic_linked_ptr< T >:
+ Collaboration diagram for mn::pointer::basic_linked_ptr< T >:

Public Types

using self_type = basic_linked_ptr< T >
 
using value_type = T
 
using element_type = T
 
using reference = T &
 
using pointer = T *
 
using base_type = basic_linked_ptr_node
 

Public Member Functions

 basic_linked_ptr ()
 Construct a new basic linked ptr object. More...
 
 basic_linked_ptr (pointer pValue)
 Construct,. More...
 
 basic_linked_ptr (const basic_linked_ptr &_pPtr)
 
template<typename U >
 basic_linked_ptr (const basic_linked_ptr< U > &_pPtr)
 
 ~basic_linked_ptr ()
 
void reset ()
 
pointer get ()
 
void force_delete ()
 
int count () const
 Returns the use count of the shared pointer. More...
 
pointer detach ()
 
bool unique ()
 If the use count of the owned pointer. More...
 
basic_linked_ptroperator= (const basic_linked_ptr &_pPtr)
 
reference operator* ()
 
pointer operator-> ()
 
 operator bool ()
 
template<typename U >
void reset (U *pValue)
 
template<typename U >
basic_linked_ptroperator= (const basic_linked_ptr< U > &_pPtr)
 
template<typename U >
basic_linked_ptroperator= (U *pValue)
 

Protected Member Functions

template<typename U >
void link (const basic_linked_ptr< U > &pOther)
 

Protected Attributes

pointer m_pValue
 

Friends

template<typename U >
class basic_linked_ptr
 

Additional Inherited Members

- Public Attributes inherited from mn::pointer::basic_linked_ptr_node
basic_linked_ptr_nodePrev
 
basic_linked_ptr_nodeNext
 

Detailed Description

template<typename T>
class mn::pointer::basic_linked_ptr< T >

This class implements a basic_linked_ptr template that it allows sharing of pointers between instances via reference counting. basic_linked_ptr objects can safely be copied.

Note
Is not thread-safe.

Member Typedef Documentation

◆ base_type

template<typename T >
using mn::pointer::basic_linked_ptr< T >::base_type = basic_linked_ptr_node

◆ element_type

template<typename T >
using mn::pointer::basic_linked_ptr< T >::element_type = T

◆ pointer

template<typename T >
using mn::pointer::basic_linked_ptr< T >::pointer = T*

◆ reference

template<typename T >
using mn::pointer::basic_linked_ptr< T >::reference = T&

◆ self_type

template<typename T >
using mn::pointer::basic_linked_ptr< T >::self_type = basic_linked_ptr<T>

◆ value_type

template<typename T >
using mn::pointer::basic_linked_ptr< T >::value_type = T

Constructor & Destructor Documentation

◆ basic_linked_ptr() [1/4]

template<typename T >
mn::pointer::basic_linked_ptr< T >::basic_linked_ptr ( )
inline

Construct a new basic linked ptr object.

◆ basic_linked_ptr() [2/4]

template<typename T >
mn::pointer::basic_linked_ptr< T >::basic_linked_ptr ( pointer  pValue)
inlineexplicit

Construct,.

Note
It is OK if the input pointer is null.

◆ basic_linked_ptr() [3/4]

template<typename T >
mn::pointer::basic_linked_ptr< T >::basic_linked_ptr ( const basic_linked_ptr< T > &  _pPtr)
inline

◆ basic_linked_ptr() [4/4]

template<typename T >
template<typename U >
mn::pointer::basic_linked_ptr< T >::basic_linked_ptr ( const basic_linked_ptr< U > &  _pPtr)
inline

◆ ~basic_linked_ptr()

template<typename T >
mn::pointer::basic_linked_ptr< T >::~basic_linked_ptr ( )
inline

Member Function Documentation

◆ count()

template<typename T >
int mn::pointer::basic_linked_ptr< T >::count ( ) const
inline

Returns the use count of the shared pointer.

Note
The return value is one if the owned pointer is null.
Returns
The use count of the shared pointer.

◆ detach()

template<typename T >
pointer mn::pointer::basic_linked_ptr< T >::detach ( )
inline

◆ force_delete()

template<typename T >
void mn::pointer::basic_linked_ptr< T >::force_delete ( )
inline

◆ get()

template<typename T >
pointer mn::pointer::basic_linked_ptr< T >::get ( void  )
inline

◆ link()

template<typename T >
template<typename U >
void mn::pointer::basic_linked_ptr< T >::link ( const basic_linked_ptr< U > &  pOther)
inlineprotected

◆ operator bool()

template<typename T >
mn::pointer::basic_linked_ptr< T >::operator bool ( )
inline

◆ operator*()

template<typename T >
reference mn::pointer::basic_linked_ptr< T >::operator* ( void  )
inline

◆ operator->()

template<typename T >
pointer mn::pointer::basic_linked_ptr< T >::operator-> ( )
inline

◆ operator=() [1/3]

template<typename T >
basic_linked_ptr& mn::pointer::basic_linked_ptr< T >::operator= ( const basic_linked_ptr< T > &  _pPtr)
inline

◆ operator=() [2/3]

template<typename T >
template<typename U >
basic_linked_ptr& mn::pointer::basic_linked_ptr< T >::operator= ( const basic_linked_ptr< U > &  _pPtr)
inline

◆ operator=() [3/3]

template<typename T >
template<typename U >
basic_linked_ptr& mn::pointer::basic_linked_ptr< T >::operator= ( U *  pValue)
inline

◆ reset() [1/2]

template<typename T >
void mn::pointer::basic_linked_ptr< T >::reset ( )
inline

◆ reset() [2/2]

template<typename T >
template<typename U >
void mn::pointer::basic_linked_ptr< T >::reset ( U *  pValue)
inline

◆ unique()

template<typename T >
bool mn::pointer::basic_linked_ptr< T >::unique ( )
inline

If the use count of the owned pointer.

Returns
true The use count of the owned pointer is one
false when not

Friends And Related Function Documentation

◆ basic_linked_ptr

template<typename T >
template<typename U >
friend class basic_linked_ptr
friend

Member Data Documentation

◆ m_pValue

template<typename T >
pointer mn::pointer::basic_linked_ptr< T >::m_pValue
protected

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