Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::unique_ptr< T, Deleter > Struct Template Reference

Simplified implementation of std::unique_ptr. More...

Inheritance diagram for Burger::unique_ptr< T, Deleter >:
Collaboration diagram for Burger::unique_ptr< T, Deleter >:

Public Types

typedef T element_type
 Object type for this unique_ptr.
 
typedef Deleter deleter_type
 Deleter type for this unique_ptr.
 
typedef T * pointer
 Pointer type of object in this unique_ptr.
 

Public Member Functions

 unique_ptr () noexcept
 
 unique_ptr (pointer pObject) noexcept
 
 unique_ptr (unique_ptr &&rInput) noexcept
 
unique_ptroperator= (unique_ptr &&rInput) noexcept
 
 ~unique_ptr ()
 Dispose of the object.
 
unique_ptroperator= (pointer pObject) noexcept
 
pointer release () noexcept
 
void reset (pointer pObject) noexcept
 
void reset (void) noexcept
 
pointer get () const noexcept
 
deleter_typeget_deleter () noexcept
 
const deleter_typeget_deleter () const noexcept
 
 operator bool () const noexcept
 
element_typeoperator* () const noexcept
 
pointer operator-> () const noexcept
 

Protected Attributes

pointer m_pObject
 Pointer to the object to track.
 
deleter_type m_Deleter
 Instance of the deleter object.
 

Private Member Functions

 unique_ptr (const unique_ptr &)=delete
 
unique_ptroperator= (const unique_ptr &)=delete
 

Detailed Description

template<class T, class Deleter = Burger::default_delete<T>>
struct Burger::unique_ptr< T, Deleter >

Simplified implementation of std::unique_ptr.


Burger::unique_ptr is a smart pointer that owns and manages a pointer to an object and disposes of the object when this class goes out of scope.

This class is based on std::unique_ptr

Note
This class can be moved, but not copied.
Template Parameters
TType of object to maintain a pointer to.
DeleterType of object to delete the object.
See also
default_delete, Free_delete or Base_delete

Member Typedef Documentation

◆ deleter_type

template<class T , class Deleter = Burger::default_delete<T>>
Deleter Burger::unique_ptr< T, Deleter >::deleter_type

Deleter type for this unique_ptr.

◆ element_type

template<class T , class Deleter = Burger::default_delete<T>>
T Burger::unique_ptr< T, Deleter >::element_type

Object type for this unique_ptr.

◆ pointer

template<class T , class Deleter = Burger::default_delete<T>>
T* Burger::unique_ptr< T, Deleter >::pointer

Pointer type of object in this unique_ptr.

Constructor & Destructor Documentation

◆ unique_ptr() [1/4]

template<class T , class Deleter = Burger::default_delete<T>>
Burger::unique_ptr< T, Deleter >::unique_ptr ( )
inlinenoexcept

◆ unique_ptr() [2/4]

template<class T , class Deleter = Burger::default_delete<T>>
Burger::unique_ptr< T, Deleter >::unique_ptr ( pointer pObject)
inlinenoexcept

◆ unique_ptr() [3/4]

template<class T , class Deleter = Burger::default_delete<T>>
Burger::unique_ptr< T, Deleter >::unique_ptr ( const unique_ptr< T, Deleter > & )
privatedelete

◆ unique_ptr() [4/4]

template<class T , class Deleter = Burger::default_delete<T>>
Burger::unique_ptr< T, Deleter >::unique_ptr ( unique_ptr< T, Deleter > && rInput)
inlinenoexcept

◆ ~unique_ptr()

template<class T , class Deleter = Burger::default_delete<T>>
Burger::unique_ptr< T, Deleter >::~unique_ptr ( )
inline

Dispose of the object.

Member Function Documentation

◆ get()

template<class T , class Deleter = Burger::default_delete<T>>
pointer Burger::unique_ptr< T, Deleter >::get ( ) const
inlinenodiscardnoexcept

◆ get_deleter() [1/2]

template<class T , class Deleter = Burger::default_delete<T>>
const deleter_type & Burger::unique_ptr< T, Deleter >::get_deleter ( ) const
inlinenodiscardnoexcept

◆ get_deleter() [2/2]

template<class T , class Deleter = Burger::default_delete<T>>
deleter_type & Burger::unique_ptr< T, Deleter >::get_deleter ( )
inlinenodiscardnoexcept

◆ operator bool()

template<class T , class Deleter = Burger::default_delete<T>>
Burger::unique_ptr< T, Deleter >::operator bool ( ) const
inlinenodiscardnoexcept

◆ operator*()

template<class T , class Deleter = Burger::default_delete<T>>
element_type & Burger::unique_ptr< T, Deleter >::operator* ( ) const
inlinenodiscardnoexcept

◆ operator->()

template<class T , class Deleter = Burger::default_delete<T>>
pointer Burger::unique_ptr< T, Deleter >::operator-> ( ) const
inlinenodiscardnoexcept

◆ operator=() [1/3]

template<class T , class Deleter = Burger::default_delete<T>>
unique_ptr & Burger::unique_ptr< T, Deleter >::operator= ( const unique_ptr< T, Deleter > & )
privatedelete

◆ operator=() [2/3]

template<class T , class Deleter = Burger::default_delete<T>>
unique_ptr & Burger::unique_ptr< T, Deleter >::operator= ( pointer pObject)
inlinenoexcept

◆ operator=() [3/3]

template<class T , class Deleter = Burger::default_delete<T>>
unique_ptr & Burger::unique_ptr< T, Deleter >::operator= ( unique_ptr< T, Deleter > && rInput)
inlinenoexcept

◆ release()

template<class T , class Deleter = Burger::default_delete<T>>
pointer Burger::unique_ptr< T, Deleter >::release ( )
inlinenoexcept

◆ reset() [1/2]

template<class T , class Deleter = Burger::default_delete<T>>
void Burger::unique_ptr< T, Deleter >::reset ( pointer pObject)
inlinenoexcept

◆ reset() [2/2]

template<class T , class Deleter = Burger::default_delete<T>>
void Burger::unique_ptr< T, Deleter >::reset ( void )
inlinenoexcept

Member Data Documentation

◆ m_Deleter

template<class T , class Deleter = Burger::default_delete<T>>
deleter_type Burger::unique_ptr< T, Deleter >::m_Deleter
protected

Instance of the deleter object.

◆ m_pObject

template<class T , class Deleter = Burger::default_delete<T>>
pointer Burger::unique_ptr< T, Deleter >::m_pObject
protected

Pointer to the object to track.