i6engine  1.0
i6e::utils::weakPtr< T, Base > Class Template Reference

A weak pointer observing a sharedPtr. More...

#include <D:/Projekte/i6engine/libs/i6engine-utils/include/i6engine/utils/sharedPtr.h>

Public Member Functions

 weakPtr ()
 default constructor More...
 
 weakPtr (const weakPtr &other)
 copy constructor copying another weak pointer More...
 
 weakPtr (weakPtr &&other)
 move constructor More...
 
 weakPtr (const sharedPtr< T, Base > &other)
 constructor takes sharedPtr with same base class More...
 
template<typename U >
 weakPtr (const sharedPtr< U, T > &other)
 constructor takes sharedPtr with same base class More...
 
template<typename U , typename V >
 weakPtr (const sharedPtr< U, V > &other)
 constructor takes sharedPtr with different types More...
 
 ~weakPtr ()
 destructor, removes sharedPtrWrapper if all weak and sharedPtr are removed More...
 
const weakPtroperator= (const weakPtr &other)
 assignment operator More...
 
const weakPtroperator= (weakPtr &&other)
 move assignment operator More...
 
bool operator== (const weakPtr &other) const
 comparison between two weak pointer More...
 
bool operator== (const T *other) const
 comparison between weak and normal pointer More...
 
bool operator!= (const weakPtr &other) const
 
bool operator!= (const T *other) const
 
bool operator< (const weakPtr &other) const
 
sharedPtr< T, Base > get () const
 returns the shared pointer being observed by this weakPtr More...
 
bool expired () const
 return true, if pointer is invalid, otherwise false More...
 

Detailed Description

template<typename T, typename Base = T>
class i6e::utils::weakPtr< T, Base >

A weak pointer observing a sharedPtr.

Definition at line 53 of file sharedPtr.h.

Constructor & Destructor Documentation

template<typename T, typename Base = T>
i6e::utils::weakPtr< T, Base >::weakPtr ( )
inline

default constructor

Definition at line 43 of file weakPtr.h.

template<typename T, typename Base = T>
i6e::utils::weakPtr< T, Base >::weakPtr ( const weakPtr< T, Base > &  other)
inline

copy constructor copying another weak pointer

Definition at line 49 of file weakPtr.h.

template<typename T, typename Base = T>
i6e::utils::weakPtr< T, Base >::weakPtr ( weakPtr< T, Base > &&  other)
inline

move constructor

Definition at line 55 of file weakPtr.h.

template<typename T, typename Base = T>
i6e::utils::weakPtr< T, Base >::weakPtr ( const sharedPtr< T, Base > &  other)
inline

constructor takes sharedPtr with same base class

Definition at line 63 of file weakPtr.h.

template<typename T, typename Base = T>
template<typename U >
i6e::utils::weakPtr< T, Base >::weakPtr ( const sharedPtr< U, T > &  other)
inline

constructor takes sharedPtr with same base class

Definition at line 70 of file weakPtr.h.

template<typename T, typename Base = T>
template<typename U , typename V >
i6e::utils::weakPtr< T, Base >::weakPtr ( const sharedPtr< U, V > &  other)
inline

constructor takes sharedPtr with different types

Definition at line 77 of file weakPtr.h.

template<typename T, typename Base = T>
i6e::utils::weakPtr< T, Base >::~weakPtr ( )
inline

destructor, removes sharedPtrWrapper if all weak and sharedPtr are removed

Definition at line 83 of file weakPtr.h.

Member Function Documentation

template<typename T, typename Base = T>
bool i6e::utils::weakPtr< T, Base >::expired ( ) const
inline

return true, if pointer is invalid, otherwise false

Definition at line 151 of file weakPtr.h.

template<typename T, typename Base = T>
sharedPtr<T, Base> i6e::utils::weakPtr< T, Base >::get ( ) const
inline

returns the shared pointer being observed by this weakPtr

Definition at line 143 of file weakPtr.h.

template<typename T, typename Base = T>
bool i6e::utils::weakPtr< T, Base >::operator!= ( const weakPtr< T, Base > &  other) const
inline

Definition at line 128 of file weakPtr.h.

template<typename T, typename Base = T>
bool i6e::utils::weakPtr< T, Base >::operator!= ( const T *  other) const
inline

Definition at line 132 of file weakPtr.h.

template<typename T, typename Base = T>
bool i6e::utils::weakPtr< T, Base >::operator< ( const weakPtr< T, Base > &  other) const
inline

Definition at line 136 of file weakPtr.h.

template<typename T, typename Base = T>
const weakPtr& i6e::utils::weakPtr< T, Base >::operator= ( const weakPtr< T, Base > &  other)
inline

assignment operator

Definition at line 89 of file weakPtr.h.

template<typename T, typename Base = T>
const weakPtr& i6e::utils::weakPtr< T, Base >::operator= ( weakPtr< T, Base > &&  other)
inline

move assignment operator

Definition at line 102 of file weakPtr.h.

template<typename T, typename Base = T>
bool i6e::utils::weakPtr< T, Base >::operator== ( const weakPtr< T, Base > &  other) const
inline

comparison between two weak pointer

Definition at line 117 of file weakPtr.h.

template<typename T, typename Base = T>
bool i6e::utils::weakPtr< T, Base >::operator== ( const T *  other) const
inline

comparison between weak and normal pointer

Definition at line 124 of file weakPtr.h.


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