Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QScopedPointer< T, Cleanup > Class Template Reference

#include <qscopedpointer.h>

+ Inheritance diagram for QScopedPointer< T, Cleanup >:
+ Collaboration diagram for QScopedPointer< T, Cleanup >:

Public Types

typedef T * pointer
 

Public Member Functions

Q_NODISCARD_CTOR QScopedPointer (T *p=nullptr) noexcept
 
 ~QScopedPointer ()
 
T & operator* () const
 
T * operator-> () const noexcept
 
bool operator! () const noexcept
 
 operator bool () const
 
T * data () const noexcept
 
T * get () const noexcept
 
bool isNull () const noexcept
 
void reset (T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
 

Protected Attributes

T * d
 

Friends

bool operator== (const QScopedPointer< T, Cleanup > &lhs, const QScopedPointer< T, Cleanup > &rhs) noexcept
 
bool operator!= (const QScopedPointer< T, Cleanup > &lhs, const QScopedPointer< T, Cleanup > &rhs) noexcept
 
bool operator== (const QScopedPointer< T, Cleanup > &lhs, std::nullptr_t) noexcept
 
bool operator== (std::nullptr_t, const QScopedPointer< T, Cleanup > &rhs) noexcept
 
bool operator!= (const QScopedPointer< T, Cleanup > &lhs, std::nullptr_t) noexcept
 
bool operator!= (std::nullptr_t, const QScopedPointer< T, Cleanup > &rhs) noexcept
 

Detailed Description

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
class QScopedPointer< T, Cleanup >

Definition at line 70 of file qscopedpointer.h.

Member Typedef Documentation

◆ pointer

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
typedef T* QScopedPointer< T, Cleanup >::pointer

Definition at line 145 of file qscopedpointer.h.

Constructor & Destructor Documentation

◆ QScopedPointer()

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
Q_NODISCARD_CTOR QScopedPointer< T, Cleanup >::QScopedPointer ( T * p = nullptr)
inlineexplicitnoexcept

Definition at line 74 of file qscopedpointer.h.

◆ ~QScopedPointer()

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
QScopedPointer< T, Cleanup >::~QScopedPointer ( )
inline

Definition at line 78 of file qscopedpointer.h.

Member Function Documentation

◆ data()

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
T * QScopedPointer< T, Cleanup >::data ( ) const
inlinenoexcept

Definition at line 105 of file qscopedpointer.h.

Referenced by QScopedPointer< QPlatformCursor >::operator!=, and QScopedPointer< QPlatformCursor >::operator==.

+ Here is the caller graph for this function:

◆ get()

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
T * QScopedPointer< T, Cleanup >::get ( ) const
inlinenoexcept

Definition at line 110 of file qscopedpointer.h.

◆ isNull()

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
bool QScopedPointer< T, Cleanup >::isNull ( ) const
inlinenoexcept

Definition at line 115 of file qscopedpointer.h.

Referenced by QScopedPointer< QPlatformCursor >::operator bool(), QScopedPointer< QPlatformCursor >::operator!=, QScopedPointer< QPlatformCursor >::operator!=, QScopedPointer< QPlatformCursor >::operator==, and QScopedPointer< QPlatformCursor >::operator==.

+ Here is the caller graph for this function:

◆ operator bool()

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
QScopedPointer< T, Cleanup >::operator bool ( ) const
inlineexplicit

Definition at line 100 of file qscopedpointer.h.

◆ operator!()

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
bool QScopedPointer< T, Cleanup >::operator! ( ) const
inlinenoexcept

Definition at line 95 of file qscopedpointer.h.

◆ operator*()

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
T & QScopedPointer< T, Cleanup >::operator* ( ) const
inline

Definition at line 84 of file qscopedpointer.h.

◆ operator->()

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
T * QScopedPointer< T, Cleanup >::operator-> ( ) const
inlinenoexcept

Definition at line 90 of file qscopedpointer.h.

◆ reset()

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
void QScopedPointer< T, Cleanup >::reset ( T * other = nullptr)
inlinenoexcept

Definition at line 120 of file qscopedpointer.h.

Friends And Related Symbol Documentation

◆ operator!= [1/3]

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
bool operator!= ( const QScopedPointer< T, Cleanup > & lhs,
const QScopedPointer< T, Cleanup > & rhs )
friend

Definition at line 152 of file qscopedpointer.h.

◆ operator!= [2/3]

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
bool operator!= ( const QScopedPointer< T, Cleanup > & lhs,
std::nullptr_t  )
friend

Definition at line 167 of file qscopedpointer.h.

◆ operator!= [3/3]

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
bool operator!= ( std::nullptr_t ,
const QScopedPointer< T, Cleanup > & rhs )
friend

Definition at line 172 of file qscopedpointer.h.

◆ operator== [1/3]

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
bool operator== ( const QScopedPointer< T, Cleanup > & lhs,
const QScopedPointer< T, Cleanup > & rhs )
friend

Definition at line 147 of file qscopedpointer.h.

◆ operator== [2/3]

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
bool operator== ( const QScopedPointer< T, Cleanup > & lhs,
std::nullptr_t  )
friend

Definition at line 157 of file qscopedpointer.h.

◆ operator== [3/3]

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
bool operator== ( std::nullptr_t ,
const QScopedPointer< T, Cleanup > & rhs )
friend

Definition at line 162 of file qscopedpointer.h.

Member Data Documentation

◆ d


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