Cppcheck
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
ValuePtr< T > Class Template Reference

#include <valueptr.h>

Classes

struct  cloner
 

Public Types

using pointer = T *
 
using element_type = T
 
using cloner_type = decltype(&cloner< T >::apply)
 

Public Member Functions

 ValuePtr ()
 
template<class U >
 ValuePtr (const U &value)
 
 ValuePtr (const ValuePtr &rhs)
 
 ValuePtr (ValuePtr &&rhs) NOEXCEPT
 
void release ()
 Releases the shared_ptr's ownership of the managed object using the .reset() function. More...
 
T * get () NOEXCEPT
 
const T * get () const NOEXCEPT
 
T & operator* ()
 
const T & operator* () const
 
T * operator-> () NOEXCEPT
 
const T * operator-> () const NOEXCEPT
 
void swap (ValuePtr &rhs)
 
ValuePtr< T > & operator= (ValuePtr rhs)
 
 operator bool () const NOEXCEPT
 

Private Attributes

std::shared_ptr< T > mPtr
 
cloner_type mClone
 

Detailed Description

template<class T>
class ValuePtr< T >

Definition at line 29 of file valueptr.h.

Member Typedef Documentation

◆ cloner_type

template<class T >
using ValuePtr< T >::cloner_type = decltype(&cloner<T>::apply)

Definition at line 40 of file valueptr.h.

◆ element_type

template<class T >
using ValuePtr< T >::element_type = T

Definition at line 39 of file valueptr.h.

◆ pointer

template<class T >
using ValuePtr< T >::pointer = T*

Definition at line 38 of file valueptr.h.

Constructor & Destructor Documentation

◆ ValuePtr() [1/4]

template<class T >
ValuePtr< T >::ValuePtr ( )
inline

Definition at line 42 of file valueptr.h.

◆ ValuePtr() [2/4]

template<class T >
template<class U >
ValuePtr< T >::ValuePtr ( const U &  value)
inline

Definition at line 47 of file valueptr.h.

◆ ValuePtr() [3/4]

template<class T >
ValuePtr< T >::ValuePtr ( const ValuePtr< T > &  rhs)
inline

Definition at line 50 of file valueptr.h.

References ValuePtr< T >::get().

◆ ValuePtr() [4/4]

template<class T >
ValuePtr< T >::ValuePtr ( ValuePtr< T > &&  rhs)
inline

Definition at line 55 of file valueptr.h.

Member Function Documentation

◆ get() [1/2]

template<class T >
const T* ValuePtr< T >::get ( ) const
inline

Definition at line 67 of file valueptr.h.

◆ get() [2/2]

template<class T >
T* ValuePtr< T >::get ( )
inline

Definition at line 64 of file valueptr.h.

Referenced by ValuePtr< T >::ValuePtr().

◆ operator bool()

template<class T >
ValuePtr< T >::operator bool ( ) const
inline

Definition at line 97 of file valueptr.h.

◆ operator*() [1/2]

template<class T >
T& ValuePtr< T >::operator* ( )
inline

Definition at line 71 of file valueptr.h.

◆ operator*() [2/2]

template<class T >
const T& ValuePtr< T >::operator* ( ) const
inline

Definition at line 74 of file valueptr.h.

◆ operator->() [1/2]

template<class T >
const T* ValuePtr< T >::operator-> ( ) const
inline

Definition at line 81 of file valueptr.h.

◆ operator->() [2/2]

template<class T >
T* ValuePtr< T >::operator-> ( )
inline

Definition at line 78 of file valueptr.h.

◆ operator=()

template<class T >
ValuePtr<T>& ValuePtr< T >::operator= ( ValuePtr< T >  rhs)
inline

Definition at line 91 of file valueptr.h.

◆ release()

template<class T >
void ValuePtr< T >::release ( )
inline

Releases the shared_ptr's ownership of the managed object using the .reset() function.

Definition at line 60 of file valueptr.h.

◆ swap()

template<class T >
void ValuePtr< T >::swap ( ValuePtr< T > &  rhs)
inline

Definition at line 85 of file valueptr.h.

References ValuePtr< T >::mClone, and ValuePtr< T >::mPtr.

Member Data Documentation

◆ mClone

template<class T >
cloner_type ValuePtr< T >::mClone
private

Definition at line 103 of file valueptr.h.

Referenced by ValuePtr< T >::swap().

◆ mPtr

template<class T >
std::shared_ptr<T> ValuePtr< T >::mPtr
private

Definition at line 102 of file valueptr.h.

Referenced by ValuePtr< T >::swap().


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