CTL  0.6.1
Computed Tomography Library
Public Member Functions | List of all members
CTL::CopyableUniquePtr< T > Class Template Reference

Extends std::unique_ptr<T> with copy operations using the clone method of type T. More...

#include <copyableuniqueptr.h>

Inheritance diagram for CTL::CopyableUniquePtr< T >:
Inheritance graph
[legend]
Collaboration diagram for CTL::CopyableUniquePtr< T >:
Collaboration graph
[legend]

Public Member Functions

 CopyableUniquePtr (std::unique_ptr< T > uniquePtr) noexcept
 
 CopyableUniquePtr (const CopyableUniquePtr< T > &other)
 
CopyableUniquePtroperator= (const CopyableUniquePtr< T > &other)
 
 CopyableUniquePtr (CopyableUniquePtr< T > &&other)=default
 
CopyableUniquePtroperator= (CopyableUniquePtr< T > &&other)=default
 
bool isNull () const noexcept
 
std::unique_ptr< T > & wrapped () noexcept
 
const std::unique_ptr< T > & wrapped () const noexcept
 

Detailed Description

template<class T>
class CTL::CopyableUniquePtr< T >

Extends std::unique_ptr<T> with copy operations using the clone method of type T.

Constructor & Destructor Documentation

◆ CopyableUniquePtr() [1/2]

template<class T>
CTL::CopyableUniquePtr< T >::CopyableUniquePtr ( std::unique_ptr< T >  uniquePtr)
noexcept

Constructs a new instance by wrapping an std::unique_ptr.

◆ CopyableUniquePtr() [2/2]

template<class T>
CTL::CopyableUniquePtr< T >::CopyableUniquePtr ( const CopyableUniquePtr< T > &  other)

Constructs a new instance by calling the clone method of other or, if other is a null pointer the object is initialized with nullptr.

Member Function Documentation

◆ isNull()

template<class T >
bool CTL::CopyableUniquePtr< T >::isNull ( ) const
noexcept

Returns true if only a null pointer is managed and false otherwise.

◆ operator=()

template<class T>
CopyableUniquePtr< T > & CTL::CopyableUniquePtr< T >::operator= ( const CopyableUniquePtr< T > &  other)

Copy-assignment of other to the current object by calling the clone method of other. If other is a null pointer, it sets the managed object to nullptr. Note that the old managed object (before assignment) gets destroyed.

◆ wrapped() [1/2]

template<class T >
std::unique_ptr< T > & CTL::CopyableUniquePtr< T >::wrapped ( )
noexcept

Returns a reference to the wrapped std::unique_ptr.

◆ wrapped() [2/2]

template<class T >
const std::unique_ptr< T > & CTL::CopyableUniquePtr< T >::wrapped ( ) const
noexcept

Returns a const reference to the wrapped std::unique_ptr.


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