The Pedigree Project 0.1
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
UniquePointer< T > Class Template Reference

#include <Pointers.h>

+ Inheritance diagram for UniquePointer< T >:
+ Collaboration diagram for UniquePointer< T >:

Public Member Functions

 UniquePointer (UniquePointer< T > &&p) noexcept
 
 NOT_COPYABLE_OR_ASSIGNABLE (UniquePointer)
 
UniquePointer< T > & operator= (UniquePointer< T > &&p) noexcept
 
T * releaseOwnership () noexcept
 
- Public Member Functions inherited from UniqueCommon< T >
T * operator* () const
 
 operator void * () const
 
T * get () const
 
void reset () noexcept
 
 NOT_COPYABLE_OR_ASSIGNABLE (UniqueCommon)
 

Static Public Member Functions

static UniquePointer< T > adopt (T *pointer)
 
template<class... Args>
static UniquePointer< T > allocate (Args &&... args)
 

Private Member Functions

 UniquePointer (T *p)
 
void move_from (UniquePointer< T > &p) noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from UniqueCommon< T >
 UniqueCommon (T *p)
 
virtual void destroy () noexcept
 
void setPointer (T *p) noexcept
 
void release () noexcept
 
- Protected Attributes inherited from UniqueCommon< T >
T * m_Pointer
 

Detailed Description

template<class T>
class UniquePointer< T >

Provides a wrapper around a single-use pointer. The copy constructor will invalidate the reference in the object being copied from.

Definition at line 79 of file Pointers.h.

Constructor & Destructor Documentation

◆ ~UniquePointer()

template<class T >
virtual UniquePointer< T >::~UniquePointer ( )
inlinevirtual

Definition at line 83 of file Pointers.h.

◆ UniquePointer() [1/2]

template<class T >
UniquePointer< T >::UniquePointer ( UniquePointer< T > &&  p)
inlinenoexcept

Definition at line 88 of file Pointers.h.

◆ UniquePointer() [2/2]

template<class T >
UniquePointer< T >::UniquePointer ( T *  p)
inlineprivate

Definition at line 118 of file Pointers.h.

Member Function Documentation

◆ adopt()

template<class T >
static UniquePointer< T > UniquePointer< T >::adopt ( T *  pointer)
inlinestatic

Take sole ownership, including a derived object with a virtual destructor.

Definition at line 101 of file Pointers.h.

Referenced by Cache::prepareDiscardFrom(), MemoryMapManager::prepareFileResize(), and X64VirtualAddressSpace::prepareRemap().

+ Here is the caller graph for this function:

◆ allocate()

template<class T >
template<class... Args>
static UniquePointer< T > UniquePointer< T >::allocate ( Args &&...  args)
inlinestatic

Definition at line 113 of file Pointers.h.

◆ move_from()

template<class T >
void UniquePointer< T >::move_from ( UniquePointer< T > &  p)
inlineprivatenoexcept

Definition at line 120 of file Pointers.h.

◆ operator=()

template<class T >
UniquePointer< T > & UniquePointer< T >::operator= ( UniquePointer< T > &&  p)
inlinenoexcept

Definition at line 95 of file Pointers.h.

◆ releaseOwnership()

template<class T >
T * UniquePointer< T >::releaseOwnership ( )
inlinenoexcept

Transfer responsibility for destruction to another owner.

Definition at line 106 of file Pointers.h.

References UniqueCommon< T >::release().


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