![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore More...
#include <qsharedpointer_impl.h>
Public Types | |
typedef T | Type |
typedef T | element_type |
typedef T | value_type |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef qptrdiff | difference_type |
Public Member Functions | |
T * | data () const noexcept |
Returns the value of the pointer referenced by this object. | |
T * | get () const noexcept |
bool | isNull () const noexcept |
Returns true if this object refers to \nullptr. | |
operator bool () const noexcept | |
Returns true if the contained pointer is not \nullptr. | |
bool | operator! () const noexcept |
Returns true if this object refers to \nullptr. | |
T & | operator* () const |
Provides access to the shared pointer's members. | |
T * | operator-> () const noexcept |
Provides access to the shared pointer's members. | |
Q_NODISCARD_CTOR constexpr | QSharedPointer () noexcept |
~QSharedPointer () | |
Destroys this QSharedPointer object. | |
Q_NODISCARD_CTOR constexpr | QSharedPointer (std::nullptr_t) noexcept |
template<class X , IfCompatible< X > = true> | |
Q_NODISCARD_CTOR | QSharedPointer (X *ptr) |
Creates a QSharedPointer that points to ptr. | |
template<class X , typename Deleter , IfCompatible< X > = true> | |
Q_NODISCARD_CTOR | QSharedPointer (X *ptr, Deleter deleter) |
Creates a QSharedPointer that points to ptr. | |
template<typename Deleter > | |
Q_NODISCARD_CTOR | QSharedPointer (std::nullptr_t, Deleter deleter) |
Q_NODISCARD_CTOR | QSharedPointer (const QSharedPointer &other) noexcept |
Creates a QSharedPointer object that shares other's pointer. | |
QSharedPointer & | operator= (const QSharedPointer &other) noexcept |
Makes this object share other's pointer. | |
Q_NODISCARD_CTOR | QSharedPointer (QSharedPointer &&other) noexcept |
Move-constructs a QSharedPointer instance, making it point at the same object that other was pointing to. | |
template<class X , IfCompatible< X > = true> | |
Q_NODISCARD_CTOR | QSharedPointer (QSharedPointer< X > &&other) noexcept |
Move-constructs a QSharedPointer instance, making it point at the same object that other was pointing to. | |
template<class X , IfCompatible< X > = true> | |
QSharedPointer & | operator= (QSharedPointer< X > &&other) noexcept |
Move-assigns other to this QSharedPointer instance. | |
template<class X , IfCompatible< X > = true> | |
Q_NODISCARD_CTOR | QSharedPointer (const QSharedPointer< X > &other) noexcept |
template<class X , IfCompatible< X > = true> | |
QSharedPointer & | operator= (const QSharedPointer< X > &other) |
template<class X , IfCompatible< X > = true> | |
Q_NODISCARD_CTOR | QSharedPointer (const QWeakPointer< X > &other) |
template<class X , IfCompatible< X > = true> | |
QSharedPointer< T > & | operator= (const QWeakPointer< X > &other) |
void | swap (QSharedPointer &other) noexcept |
void | reset () |
void | reset (T *t) |
template<typename Deleter > | |
void | reset (T *t, Deleter deleter) |
template<class X > | |
QSharedPointer< X > | staticCast () const |
Performs a static cast from this pointer's type to \tt X and returns a QSharedPointer that shares the reference. | |
template<class X > | |
QSharedPointer< X > | dynamicCast () const |
Performs a dynamic cast from this pointer's type to \tt X and returns a QSharedPointer that shares the reference. | |
template<class X > | |
QSharedPointer< X > | constCast () const |
Performs a \tt const_cast from this pointer's type to \tt X and returns a QSharedPointer that shares the reference. | |
template<class X > | |
QSharedPointer< X > | objectCast () const |
void | clear () |
Clears this QSharedPointer object, dropping the reference that it may have had to the pointer. | |
QWeakPointer< T > | toWeakRef () const |
Returns a weak reference object that shares the pointer referenced by this object. | |
DECLARE_TEMPLATE_COMPARE_SET (const QSharedPointer &p1, p1.data(), const QSharedPointer< X > &p2, p2.data()) private | |
void | deref () noexcept |
template<class X > | |
void | enableSharedFromThis (const QEnableSharedFromThis< X > *ptr) |
void | enableSharedFromThis (...) |
template<typename X , typename Deleter > | |
void | internalConstruct (X *ptr, Deleter deleter) |
void | internalSwap (QSharedPointer &other) noexcept |
void | ref () const noexcept |
void | internalSet (Data *o, T *actual) |
Static Public Member Functions | |
template<typename... Args> | |
static QSharedPointer | create (Args &&...arguments) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static void | deref (Data *dd) noexcept |
Public Attributes | |
Type * | value |
Data * | d |
Friends | |
template<class X > | |
class | QSharedPointer |
Creates a QSharedPointer that is null (the object is holding a reference to \nullptr). | |
template<class X > | |
class | QWeakPointer |
template<class X , class Y > | |
QSharedPointer< X > | QtSharedPointer::copyAndSetPointer (X *ptr, const QSharedPointer< Y > &src) |
Related Symbols | |
(Note that these are not member symbols.) | |
template< typename T > QDebug | operator<< (QDebug debug, const QSharedPointer< T > &ptr) |
template< class T > | qHash (const QSharedPointer< T > &key, size_t seed) |
Returns the hash value for key, using seed to seed the calculation. | |
template< class T > template< class X > bool | operator== (const QSharedPointer< T > &ptr1, const QSharedPointer< X > &ptr2) |
Returns true if ptr1 and ptr2 refer to the same pointer. | |
template< class T > template< class X > bool | operator!= (const QSharedPointer< T > &ptr1, const QSharedPointer< X > &ptr2) |
Returns true if ptr1 and ptr2 refer to distinct pointers. | |
template< class T > template< class X > bool | operator== (const QSharedPointer< T > &ptr1, const X *ptr2) |
Returns true if ptr1 and ptr2 refer to the same pointer. | |
template< class T > template< class X > bool | operator!= (const QSharedPointer< T > &ptr1, const X *ptr2) |
Returns true if ptr1 and ptr2 refer to distinct pointers. | |
template< class T > template< class X > bool | operator== (const T *ptr1, const QSharedPointer< X > &ptr2) |
Returns true if the pointer ptr1 is the same pointer as that referenced by ptr2. | |
template< class T > template< class X > bool | operator!= (const T *ptr1, const QSharedPointer< X > &ptr2) |
Returns true if the pointer ptr1 is not the same pointer as that referenced by ptr2. | |
template< class T > bool | operator== (const QSharedPointer< T > &lhs, std::nullptr_t) |
template< class T > bool | operator== (std::nullptr_t, const QSharedPointer< T > &rhs) |
template< class T > bool | operator!= (const QSharedPointer< T > &lhs, std::nullptr_t) |
template< class T > bool | operator!= (std::nullptr_t, const QSharedPointer< T > &rhs) |
template< class X > template< class T > QSharedPointer< X > | qSharedPointerCast (const QSharedPointer< T > &other) |
Returns a shared pointer to the pointer held by other, cast to type \tt X. | |
template< class X > template< class T > QSharedPointer< X > | qSharedPointerDynamicCast (const QSharedPointer< T > &src) |
Returns a shared pointer to the pointer held by src, using a dynamic cast to type \tt X to obtain an internal pointer of the appropriate type. | |
template< class X > template< class T > QSharedPointer< X > | qSharedPointerConstCast (const QSharedPointer< T > &src) |
Returns a shared pointer to the pointer held by src, cast to type \tt X. | |
template< class X > template< class T > QSharedPointer< X > | qSharedPointerObjectCast (const QSharedPointer< T > &src) |
The qSharedPointerObjectCast function is for casting a shared pointer. | |
template< class X, class T > std::shared_ptr< X > | qSharedPointerObjectCast (const std::shared_ptr< T > &src) |
template< class X, class T > std::shared_ptr< X > | qobject_pointer_cast (const std::shared_ptr< T > &src) |
template< class X, class T > std::shared_ptr< X > | qSharedPointerObjectCast (std::shared_ptr< T > &&src) |
template< class X, class T > std::shared_ptr< X > | qobject_pointer_cast (std::shared_ptr< T > &&src) |
\inmodule QtCore
The QSharedPointer class holds a strong reference to a shared pointer.
\reentrant
The QSharedPointer is an automatic, shared pointer in C++. It behaves exactly like a normal pointer for normal purposes, including respect for constness.
QSharedPointer will delete the pointer it is holding when it goes out of scope, provided no other QSharedPointer objects are referencing it.
A QSharedPointer object can be created from a normal pointer, another QSharedPointer object or by promoting a QWeakPointer object to a strong reference.
Definition at line 255 of file qsharedpointer_impl.h.
typedef const value_type* QSharedPointer< T >::const_pointer |
Definition at line 266 of file qsharedpointer_impl.h.
typedef const value_type& QSharedPointer< T >::const_reference |
Definition at line 268 of file qsharedpointer_impl.h.
typedef qptrdiff QSharedPointer< T >::difference_type |
Definition at line 269 of file qsharedpointer_impl.h.
typedef T QSharedPointer< T >::element_type |
Definition at line 263 of file qsharedpointer_impl.h.
typedef value_type* QSharedPointer< T >::pointer |
Definition at line 265 of file qsharedpointer_impl.h.
typedef value_type& QSharedPointer< T >::reference |
Definition at line 267 of file qsharedpointer_impl.h.
typedef T QSharedPointer< T >::Type |
Definition at line 262 of file qsharedpointer_impl.h.
typedef T QSharedPointer< T >::value_type |
Definition at line 264 of file qsharedpointer_impl.h.
|
inlineconstexprnoexcept |
Definition at line 280 of file qsharedpointer_impl.h.
|
inline |
Destroys this QSharedPointer object.
If it is the last reference to the pointer stored, this will delete the pointer as well.
Definition at line 281 of file qsharedpointer_impl.h.
References QSharedPointer< T >::deref().
|
inlineconstexprnoexcept |
Creates a QSharedPointer that is null. This is equivalent to the QSharedPointer default constructor.
Definition at line 284 of file qsharedpointer_impl.h.
|
inlineexplicit |
Creates a QSharedPointer that points to ptr.
The pointer ptr becomes managed by this QSharedPointer and must not be passed to another QSharedPointer object or deleted outside this object.
Since Qt 5.8, when the last reference to this QSharedPointer gets destroyed, ptr will be deleted by calling X's
destructor (even if X
is not the same as QSharedPointer's template parameter T
). Previously, the destructor for T
was called.
Definition at line 288 of file qsharedpointer_impl.h.
References QSharedPointer< T >::internalConstruct(), and ptr().
|
inline |
Creates a QSharedPointer that points to ptr.
The pointer ptr becomes managed by this QSharedPointer and must not be passed to another QSharedPointer object or deleted outside this object.
The deleter parameter d specifies the custom deleter for this object. The custom deleter is called, instead of the operator delete(), when the strong reference count drops to 0. This is useful, for instance, for calling \l {QObject::}{deleteLater()} on a QObject instead:
Note that the custom deleter function will be called with a pointer to type X
, even if the QSharedPointer template parameter T
is not the same.
It is also possible to specify a member function directly, as in:
Definition at line 293 of file qsharedpointer_impl.h.
References QSharedPointer< T >::internalConstruct(), and ptr().
|
inline |
Creates a QSharedPointer that is null. This is equivalent to the QSharedPointer default constructor.
The deleter parameter d specifies the custom deleter for this object. The custom deleter is called, instead of the operator delete(), when the strong reference count drops to 0.
Definition at line 298 of file qsharedpointer_impl.h.
References QSharedPointer< T >::internalConstruct().
|
inlinenoexcept |
Creates a QSharedPointer object that shares other's pointer.
If \tt T is a derived type of the template parameter of this class, QSharedPointer will perform an automatic cast. Otherwise, you will get a compiler error.
Definition at line 302 of file qsharedpointer_impl.h.
References QSharedPointer< T >::d, and QSharedPointer< T >::ref().
|
inlinenoexcept |
Move-constructs a QSharedPointer instance, making it point at the same object that other was pointing to.
Definition at line 311 of file qsharedpointer_impl.h.
References other().
|
inlinenoexcept |
Move-constructs a QSharedPointer instance, making it point at the same object that other was pointing to.
This constructor participates in overload resolution only if {X*} implicitly converts to
{T*}.
Definition at line 321 of file qsharedpointer_impl.h.
References other().
|
inlinenoexcept |
Definition at line 338 of file qsharedpointer_impl.h.
References QSharedPointer< T >::d, and QSharedPointer< T >::ref().
|
inline |
Definition at line 351 of file qsharedpointer_impl.h.
References other().
|
inline |
Clears this QSharedPointer object, dropping the reference that it may have had to the pointer.
If this was the last reference, then the pointer itself will be deleted.
Definition at line 394 of file qsharedpointer_impl.h.
References copy(), and QSharedPointer< T >::swap().
Referenced by QLowEnergyControllerPrivateBluez::discoverServiceDetails(), QLowEnergyControllerPrivateBluezDBus::discoverServiceDetails(), and QSharedPointer< T >::reset().
|
inline |
Performs a \tt const_cast from this pointer's type to \tt X and returns a QSharedPointer that shares the reference.
This function can be used for up- and for down-casting, but is more useful for up-casting.
Definition at line 381 of file qsharedpointer_impl.h.
Referenced by QSharedPointer< T >::enableSharedFromThis().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Creates a QSharedPointer object and allocates a new item of type \tt T. The QSharedPointer internals and the object are allocated in one single memory allocation, which could help reduce memory fragmentation in a long-running application.
This function will attempt to call a constructor for type \tt T that can accept all the arguments passed (args). Arguments will be perfectly-forwarded.
Definition at line 399 of file qsharedpointer_impl.h.
References arguments, ptr(), and Qt::Uninitialized.
Referenced by QLowEnergyControllerPrivate::addServiceHelper(), QFontDialogOptions::clone(), QFileDialogOptions::clone(), QMessageDialogOptions::clone(), QFontDialogOptions::create(), QFileDialogOptions::create(), QMessageDialogOptions::create(), QLowEnergyControllerPrivateBluezDBus::discoverServiceDetails(), QLowEnergyControllerPrivateBluezDBus::discoverServices(), AVFImageCapture::doCapture(), QQuickTheme::setFont(), and QQuickTheme::setPalette().
|
inlinenoexcept |
Returns the value of the pointer referenced by this object.
Note: do not delete the pointer returned by this function or pass it to another function that could delete it, including creating QSharedPointer or QWeakPointer objects.
Definition at line 271 of file qsharedpointer_impl.h.
References QSharedPointer< T >::value.
Referenced by QDtlsPrivateOpenSSL::continueHandshake(), QDeferredSharedPointer< T >::data(), QDtlsPrivateOpenSSL::decryptDatagram(), QQuickTheme::font(), QDtlsPrivateOpenSSL::handleTimeout(), QSharedPointer< T >::isNull(), QSharedPointer< T >::operator*(), operator-(), operator-(), operator-(), QSharedPointer< T >::operator->(), operator<(), operator<(), operator<(), QQuickTheme::palette(), QNetworkReplyHttpImplPrivate::replyDownloadMetaData(), QDtlsPrivateOpenSSL::sendShutdownAlert(), QNetworkReplyImplPrivate::setDownloadBuffer(), QQuickAnimatorController::start(), QDtlsPrivateOpenSSL::startHandshake(), QWindowsMouseHandler::translateMouseEvent(), QWindowsPointerHandler::translateMouseEvent(), QWindowsTabletSupport::translateTabletPacketEvent(), QWindowsTabletSupport::translateTabletProximityEvent(), QWindowsMouseHandler::translateTouchEvent(), QDtlsClientVerifierOpenSSL::verifyClient(), and QDtlsPrivateOpenSSL::writeDatagramEncrypted().
|
inline |
Definition at line 438 of file qsharedpointer_impl.h.
|
inlinenoexcept |
Definition at line 450 of file qsharedpointer_impl.h.
References QSharedPointer< T >::d, and QSharedPointer< T >::deref().
Referenced by QSharedPointer< T >::~QSharedPointer(), QSharedPointer< T >::deref(), and QSharedPointer< T >::internalSet().
|
inlinestaticnoexcept |
Definition at line 452 of file qsharedpointer_impl.h.
|
inline |
Performs a dynamic cast from this pointer's type to \tt X and returns a QSharedPointer that shares the reference.
If this function is used to up-cast, then QSharedPointer will perform a \tt dynamic_cast, which means that if the object being pointed by this QSharedPointer is not of type \tt X, the returned object will be null.
Note: the template type X
must have the same const and volatile qualifiers as the template of this object, or the cast will fail. Use constCast() if you need to drop those qualifiers.
Definition at line 375 of file qsharedpointer_impl.h.
|
inline |
Definition at line 468 of file qsharedpointer_impl.h.
|
inline |
Definition at line 463 of file qsharedpointer_impl.h.
References QSharedPointer< T >::constCast(), and ptr().
Referenced by QSharedPointer< T >::internalConstruct().
|
inlinenoexcept |
Same as data().
This function is provided for API compatibility with {std::shared_ptr}.
Definition at line 272 of file qsharedpointer_impl.h.
References QSharedPointer< T >::value.
Referenced by QCocoaWindow::createNSWindow(), and createPixmapDataSync().
|
inline |
Definition at line 471 of file qsharedpointer_impl.h.
References QSharedPointer< T >::d, QSharedPointer< T >::enableSharedFromThis(), ptr(), and QtSharedPointer::ExternalRefCountData::setQObjectShared().
Referenced by QSharedPointer< T >::QSharedPointer(), QSharedPointer< T >::QSharedPointer(), and QSharedPointer< T >::QSharedPointer().
|
inline |
Definition at line 499 of file qsharedpointer_impl.h.
References QSharedPointer< T >::d, QSharedPointer< T >::deref(), QBasicAtomicInteger< T >::loadRelaxed(), o, qt_ptr_swap(), and QtSharedPointer::ExternalRefCountData::strongref.
Referenced by QSharedPointer< T >::operator=().
|
inlinenoexcept |
Definition at line 488 of file qsharedpointer_impl.h.
References QSharedPointer< T >::d, other(), and qt_ptr_swap().
Referenced by QSharedPointer< T >::swap().
|
inlinenoexcept |
Returns true
if this object refers to \nullptr.
Definition at line 273 of file qsharedpointer_impl.h.
References QSharedPointer< T >::data().
Referenced by QLowEnergyControllerPrivateBluezDBus::addToGenericAttributeList(), QLowEnergyService::contains(), QLowEnergyService::contains(), QHttpThreadDelegate::dataReadProgressSlot(), QLowEnergyCharacteristic::descriptor(), QLowEnergyCharacteristic::descriptors(), QLowEnergyControllerPrivateAndroid::discoverServiceDetails(), QSSGShaderLibraryManager::getIncludeContents(), QWindowsDialogHelperBase< BaseClass >::hasNativeDialog(), QLowEnergyCharacteristic::isValid(), QLowEnergyDescriptor::isValid(), NmeaSource::isValid(), NmeaSatelliteSource::isValid(), QSharedPointer< T >::operator bool(), QSharedPointer< T >::operator!(), QLowEnergyCharacteristic::properties(), QHttpThreadDelegate::readyReadSlot(), QGeoTileRequestManagerPrivate::requestTiles(), QCocoaMessageDialog::show(), QWindowsMouseHandler::translateMouseEvent(), QWindowsPointerHandler::translateMouseEvent(), QWindowsTabletSupport::translateTabletPacketEvent(), QWindowsTabletSupport::translateTabletProximityEvent(), QGeoTiledMapPrivate::updateTile(), QLowEnergyCharacteristic::uuid(), QLowEnergyDescriptor::uuid(), QLowEnergyCharacteristic::value(), QLowEnergyDescriptor::value(), and QWindowsContext::windowsProc().
|
inline |
Performs a \l qobject_cast() from this pointer's type to \tt X and returns a QSharedPointer that shares the reference. If this function is used to up-cast, then QSharedPointer will perform a \tt qobject_cast, which means that if the object being pointed by this QSharedPointer is not of type \tt X, the returned object will be null.
Note: the template type X
must have the same const and volatile qualifiers as the template of this object, or the cast will fail. Use constCast() if you need to drop those qualifiers.
Definition at line 388 of file qsharedpointer_impl.h.
|
inlineexplicitnoexcept |
Returns true
if the contained pointer is not \nullptr.
This function is suitable for use in \tt if-constructs, like:
Definition at line 274 of file qsharedpointer_impl.h.
References QSharedPointer< T >::isNull().
|
inlinenoexcept |
Returns true
if this object refers to \nullptr.
This function is suitable for use in \tt if-constructs, like:
Definition at line 275 of file qsharedpointer_impl.h.
References QSharedPointer< T >::isNull().
|
inline |
Provides access to the shared pointer's members.
If the contained pointer is \nullptr, behavior is undefined.
Definition at line 276 of file qsharedpointer_impl.h.
References QSharedPointer< T >::data().
|
inlinenoexcept |
Provides access to the shared pointer's members.
If the contained pointer is \nullptr, behavior is undefined.
Definition at line 277 of file qsharedpointer_impl.h.
References QSharedPointer< T >::data().
|
inlinenoexcept |
Makes this object share other's pointer.
The current pointer reference is discarded and, if it was the last, the pointer will be deleted.
If \tt T is a derived type of the template parameter of this class, QSharedPointer will perform an automatic cast. Otherwise, you will get a compiler error.
Definition at line 304 of file qsharedpointer_impl.h.
References copy(), other(), and QSharedPointer< T >::swap().
|
inline |
Definition at line 342 of file qsharedpointer_impl.h.
References copy(), other(), and QSharedPointer< T >::swap().
|
inline |
Definition at line 355 of file qsharedpointer_impl.h.
References QSharedPointer< T >::internalSet(), and other().
|
inlinenoexcept |
Move-assigns other to this QSharedPointer instance.
This assignment operator participates in overload resolution only if {X*} implicitly converts to
{T*}.
Definition at line 329 of file qsharedpointer_impl.h.
References other(), and QSharedPointer< T >::swap().
|
inlinenoexcept |
Definition at line 497 of file qsharedpointer_impl.h.
References QSharedPointer< T >::d, QBasicAtomicInteger< T >::ref(), QtSharedPointer::ExternalRefCountData::strongref, and QtSharedPointer::ExternalRefCountData::weakref.
Referenced by QSharedPointer< T >::QSharedPointer(), and QSharedPointer< T >::QSharedPointer().
|
inline |
Same as clear(). For std::shared_ptr compatibility.
Definition at line 361 of file qsharedpointer_impl.h.
References QSharedPointer< T >::clear().
Referenced by QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(), QQuickAnimatorProxyJob::~QQuickAnimatorProxyJob(), requestPermissionsInternal(), and QWindowsTabletSupport::translateTabletProximityEvent().
|
inline |
Resets this QSharedPointer object to point to t instead. Equivalent to:
Definition at line 362 of file qsharedpointer_impl.h.
References copy(), and QSharedPointer< T >::swap().
|
inline |
Resets this QSharedPointer object to point to t instead, with the Deleter deleter. Equivalent to:
Definition at line 365 of file qsharedpointer_impl.h.
References copy(), and QSharedPointer< T >::swap().
|
inline |
Performs a static cast from this pointer's type to \tt X and returns a QSharedPointer that shares the reference.
This function can be used for up- and for down-casting, but is more useful for up-casting.
Note: the template type X
must have the same const and volatile qualifiers as the template of this object, or the cast will fail. Use constCast() if you need to drop those qualifiers.
Definition at line 369 of file qsharedpointer_impl.h.
|
inlinenoexcept |
Swaps this shared pointer instance with other. This function is very fast and never fails.
Definition at line 358 of file qsharedpointer_impl.h.
References QSharedPointer< T >::internalSwap(), and other().
Referenced by QSharedPointer< T >::clear(), QSharedPointer< T >::operator=(), QSharedPointer< T >::operator=(), QSharedPointer< T >::operator=(), QSharedPointer< T >::reset(), and QSharedPointer< T >::reset().
Q_INLINE_TEMPLATE QWeakPointer< T > QSharedPointer< T >::toWeakRef |
Returns a weak reference object that shares the pointer referenced by this object.
Definition at line 797 of file qsharedpointer_impl.h.
|
friend |
Creates a QSharedPointer that is null (the object is holding a reference to \nullptr).
Definition at line 494 of file qsharedpointer_impl.h.
|
related |
Returns true
if lhs refers to a valid (i.e. non-null) pointer.
|
related |
Returns true
if ptr1 and ptr2 refer to distinct pointers.
If ptr2's template parameter is different from ptr1's, QSharedPointer will attempt to perform an automatic \tt static_cast to ensure that the pointers being compared are equal. If ptr2's template parameter is not a base or a derived type from ptr1's, you will get a compiler error.
|
related |
Returns true
if ptr1 and ptr2 refer to distinct pointers.
If ptr2's type is different from ptr1's, QSharedPointer will attempt to perform an automatic \tt static_cast to ensure that the pointers being compared are equal. If ptr2's type is not a base or a derived type from this ptr1's, you will get a compiler error.
|
related |
Returns true
if the pointer ptr1 is not the same pointer as that referenced by ptr2.
If ptr2's template parameter is different from ptr1's type, QSharedPointer will attempt to perform an automatic \tt static_cast to ensure that the pointers being compared are equal. If ptr2's template parameter is not a base or a derived type from ptr1's type, you will get a compiler error.
|
related |
Returns true
if rhs refers to a valid (i.e. non-null) pointer.
|
related |
|
related |
|
related |
Returns true
if ptr1 and ptr2 refer to the same pointer.
If ptr2's template parameter is different from ptr1's, QSharedPointer will attempt to perform an automatic \tt static_cast to ensure that the pointers being compared are equal. If ptr2's template parameter is not a base or a derived type from ptr1's, you will get a compiler error.
|
related |
Returns true
if ptr1 and ptr2 refer to the same pointer.
If ptr2's type is different from ptr1's, QSharedPointer will attempt to perform an automatic \tt static_cast to ensure that the pointers being compared are equal. If ptr2's type is not a base or a derived type from this ptr1's, you will get a compiler error.
|
related |
Returns true
if the pointer ptr1 is the same pointer as that referenced by ptr2.
If ptr2's template parameter is different from ptr1's type, QSharedPointer will attempt to perform an automatic \tt static_cast to ensure that the pointers being compared are equal. If ptr2's template parameter is not a base or a derived type from ptr1's type, you will get a compiler error.
|
related |
|
related |
Returns the hash value for key, using seed to seed the calculation.
Definition at line 790 of file qsharedpointer_impl.h.
References ptr(), qHash(), and seed.
|
related |
Returns a shared pointer to the pointer held by src.
Same as qSharedPointerObjectCast(). This function is provided for STL compatibility.
Definition at line 911 of file qsharedpointer_impl.h.
|
related |
Same as qSharedPointerObjectCast(). This function is provided for STL compatibility.
Definition at line 918 of file qsharedpointer_impl.h.
|
related |
Returns a shared pointer to the pointer held by other, cast to type \tt X.
The types \tt T and \tt X must belong to one hierarchy for the \tt static_cast to succeed.
Note that \tt X must have the same cv-qualifiers (\tt const and \tt volatile) that \tt T has, or the code will fail to compile. Use qSharedPointerConstCast to cast away the constness.
|
related |
Returns a shared pointer to the pointer held by src, cast to type \tt X.
The types \tt T and \tt X must belong to one hierarchy for the \tt const_cast to succeed. The \tt const and \tt volatile differences between \tt T and \tt X are ignored.
|
related |
Returns a shared pointer to the pointer held by src, using a dynamic cast to type \tt X to obtain an internal pointer of the appropriate type.
If the \tt dynamic_cast fails, the object returned will be null.
Note that \tt X must have the same cv-qualifiers (\tt const and \tt volatile) that \tt T has, or the code will fail to compile. Use qSharedPointerConstCast to cast away the constness.
|
related |
The qSharedPointerObjectCast function is for casting a shared pointer.
Returns a shared pointer to the pointer held by src, using a \l qobject_cast() to type \tt X to obtain an internal pointer of the appropriate type. If the \tt qobject_cast fails, the object returned will be null.
Note that \tt X must have the same cv-qualifiers (\tt const and \tt volatile) that \tt T has, or the code will fail to compile. Use qSharedPointerConstCast to cast away the constness.
|
related |
Returns a shared pointer to the pointer held by src, using a \l qobject_cast() to type \tt X to obtain an internal pointer of the appropriate type. If the \tt qobject_cast fails, the object returned will be null.
Note that \tt X must have the same cv-qualifiers (\tt const and \tt volatile) that \tt T has, or the code will fail to compile. Use const_pointer_cast to cast away the constness.
Definition at line 933 of file qsharedpointer_impl.h.
|
related |
Returns a shared pointer to the pointer held by src, using a \l qobject_cast() to type \tt X to obtain an internal pointer of the appropriate type.
If the \tt qobject_cast succeeds, the function will return a valid shared pointer, and src is reset to null. If the \tt qobject_cast fails, the object returned will be null, and src will not be modified.
Note that \tt X must have the same cv-qualifiers (\tt const and \tt volatile) that \tt T has, or the code will fail to compile. Use const_pointer_cast to cast away the constness.
Definition at line 939 of file qsharedpointer_impl.h.
|
friend |
Definition at line 495 of file qsharedpointer_impl.h.
Data* QSharedPointer< T >::d |
Definition at line 530 of file qsharedpointer_impl.h.
Referenced by QSharedPointer< T >::QSharedPointer(), QSharedPointer< T >::QSharedPointer(), QSharedPointer< T >::deref(), QSharedPointer< T >::internalConstruct(), QSharedPointer< T >::internalSet(), QSharedPointer< T >::internalSwap(), and QSharedPointer< T >::ref().
Type* QSharedPointer< T >::value |
Definition at line 529 of file qsharedpointer_impl.h.
Referenced by QSharedPointer< T >::data(), and QSharedPointer< T >::get().