Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Attributes | List of all members
utility::pointer::DeepCopyOP< T > Class Template Reference

#include <deep_copy.hh>

Public Types

typedef
utility::pointer::shared_ptr
< T
pointer_type
 

Public Member Functions

constexpr DeepCopyOP () noexcept
 
constexpr DeepCopyOP (std::nullptr_t const &null) noexcept
 
 DeepCopyOP (pointer_type const &val)
 
 DeepCopyOP (T *val)
 
 DeepCopyOP (DeepCopyOP const &r) noexcept
 Copy constructor – This is what the effort is about. More...
 
 DeepCopyOP (DeepCopyOP const &&r) noexcept
 Move constructor. More...
 
 ~DeepCopyOP ()=default
 
DeepCopyOPoperator= (DeepCopyOP const &r)
 Standard assignment operator, needed for implicit assignment operator of containing class. More...
 
DeepCopyOPoperator= (DeepCopyOP &&r)
 Move assignment operator. More...
 
DeepCopyOPoperator= (pointer_type const &val)
 Assignment from OP. More...
 
DeepCopyOPoperator= (pointer_type &&val)
 Move assignement operator for OPs. More...
 
DeepCopyOPoperator= (std::nullptr_t const &val)
 
 operator shared_ptr< typename std::remove_const< T >::type > () const
 Conversion operator to allow a DeepCopyOP to be passed as a plain OP. More...
 
 operator shared_ptr< typename std::add_const< T >::type > () const
 Conversion operator which allows an OP -> COP change. More...
 
void swap (DeepCopyOP &r) noexcept
 
void swap (pointer_type &r) noexcept
 
Tget () const noexcept
 
Toperator* () const noexcept
 
Toperator-> () const noexcept
 
DeepCopyOP::pointer_type get_op () const
 
 operator bool () const noexcept
 
bool operator== (DeepCopyOP const &r) const
 
bool operator== (pointer_type const &val) const
 
bool operator== (std::nullptr_t const &null) const
 
bool operator!= (DeepCopyOP const &r) const
 
bool operator!= (pointer_type const &val) const
 
bool operator!= (std::nullptr_t const &null) const
 

Private Attributes

pointer_type val_
 

Member Typedef Documentation

template<class T>
typedef utility::pointer::shared_ptr< T > utility::pointer::DeepCopyOP< T >::pointer_type

Constructor & Destructor Documentation

template<class T>
constexpr utility::pointer::DeepCopyOP< T >::DeepCopyOP ( )
inlinenoexcept
template<class T>
constexpr utility::pointer::DeepCopyOP< T >::DeepCopyOP ( std::nullptr_t const &  null)
inlinenoexcept
template<class T>
utility::pointer::DeepCopyOP< T >::DeepCopyOP ( pointer_type const &  val)
inline
template<class T>
utility::pointer::DeepCopyOP< T >::DeepCopyOP ( T val)
inlineexplicit
template<class T>
utility::pointer::DeepCopyOP< T >::DeepCopyOP ( DeepCopyOP< T > const &  r)
inlinenoexcept

Copy constructor – This is what the effort is about.

template<class T>
utility::pointer::DeepCopyOP< T >::DeepCopyOP ( DeepCopyOP< T > const &&  r)
inlinenoexcept

Move constructor.

Because the rvalue is disappearing, there's no need to actually make a deep copy – there's no reference which should be sharing this value

template<class T>
utility::pointer::DeepCopyOP< T >::~DeepCopyOP ( )
default

Member Function Documentation

template<class T>
T* utility::pointer::DeepCopyOP< T >::get ( ) const
inlinenoexcept
template<class T>
DeepCopyOP::pointer_type utility::pointer::DeepCopyOP< T >::get_op ( ) const
inline
template<class T>
utility::pointer::DeepCopyOP< T >::operator bool ( ) const
inlineexplicitnoexcept
template<class T>
utility::pointer::DeepCopyOP< T >::operator shared_ptr< typename std::add_const< T >::type > ( ) const
inline

Conversion operator which allows an OP -> COP change.

References utility::pointer::DeepCopyOP< T >::val_.

template<class T>
utility::pointer::DeepCopyOP< T >::operator shared_ptr< typename std::remove_const< T >::type > ( ) const
inline

Conversion operator to allow a DeepCopyOP to be passed as a plain OP.

While this actually won't allow you to convert a COP to an OP (you'll get a obtuse-but-interpretable compiler error if you try) the remove_const is needed to avoid an unconditional compiler error for just using DeepCopyOP with a COP

References utility::pointer::DeepCopyOP< T >::val_.

template<class T>
bool utility::pointer::DeepCopyOP< T >::operator!= ( DeepCopyOP< T > const &  r) const
inline
template<class T>
bool utility::pointer::DeepCopyOP< T >::operator!= ( pointer_type const &  val) const
inline
template<class T>
bool utility::pointer::DeepCopyOP< T >::operator!= ( std::nullptr_t const &  null) const
inline
template<class T>
T& utility::pointer::DeepCopyOP< T >::operator* ( ) const
inlinenoexcept
template<class T>
T* utility::pointer::DeepCopyOP< T >::operator-> ( ) const
inlinenoexcept
template<class T>
DeepCopyOP& utility::pointer::DeepCopyOP< T >::operator= ( DeepCopyOP< T > const &  r)
inline

Standard assignment operator, needed for implicit assignment operator of containing class.

References numeric::interpolation::spline::deep_copy(), and utility::pointer::DeepCopyOP< T >::val_.

template<class T>
DeepCopyOP& utility::pointer::DeepCopyOP< T >::operator= ( DeepCopyOP< T > &&  r)
inline

Move assignment operator.

The RHS is disappearing, so we can steal the value

References swap(), and utility::pointer::DeepCopyOP< T >::val_.

template<class T>
DeepCopyOP& utility::pointer::DeepCopyOP< T >::operator= ( pointer_type const &  val)
inline

Assignment from OP.

This is what's used to manually set the value within the class. We don't need to clone.

References utility::pointer::DeepCopyOP< T >::val_.

template<class T>
DeepCopyOP& utility::pointer::DeepCopyOP< T >::operator= ( pointer_type &&  val)
inline

Move assignement operator for OPs.

References swap(), and utility::pointer::DeepCopyOP< T >::val_.

template<class T>
DeepCopyOP& utility::pointer::DeepCopyOP< T >::operator= ( std::nullptr_t const &  val)
inline

We need to overload the nullptr_t otherwise we get compiler issues

References utility::pointer::DeepCopyOP< T >::val_.

template<class T>
bool utility::pointer::DeepCopyOP< T >::operator== ( DeepCopyOP< T > const &  r) const
inline
template<class T>
bool utility::pointer::DeepCopyOP< T >::operator== ( pointer_type const &  val) const
inline
template<class T>
bool utility::pointer::DeepCopyOP< T >::operator== ( std::nullptr_t const &  null) const
inline
template<class T>
void utility::pointer::DeepCopyOP< T >::swap ( DeepCopyOP< T > &  r)
inlinenoexcept
template<class T>
void utility::pointer::DeepCopyOP< T >::swap ( pointer_type r)
inlinenoexcept

Member Data Documentation

template<class T>
pointer_type utility::pointer::DeepCopyOP< T >::val_
private

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