Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QtSharedPointer::ExternalRefCountData Struct Reference

#include <qsharedpointer_impl.h>

+ Inheritance diagram for QtSharedPointer::ExternalRefCountData:
+ Collaboration diagram for QtSharedPointer::ExternalRefCountData:

Public Types

typedef void(* DestroyerFn) (ExternalRefCountData *)
 

Public Member Functions

 ExternalRefCountData (DestroyerFn d)
 
 ExternalRefCountData (Qt::Initialization)
 
 ~ExternalRefCountData ()
 
void destroy ()
 
Q_CORE_EXPORT void setQObjectShared (const QObject *, bool enable)
 
Q_CORE_EXPORT void checkQObjectShared (const QObject *)
 
void checkQObjectShared (...)
 
void setQObjectShared (...)
 
voidoperator new (std::size_t)=delete
 
voidoperator new (std::size_t, void *ptr) noexcept
 
void operator delete (void *ptr)
 
void operator delete (void *, void *)
 

Static Public Member Functions

static Q_CORE_EXPORT ExternalRefCountDatagetAndRef (const QObject *)
 

Public Attributes

QBasicAtomicInt weakref
 
QBasicAtomicInt strongref
 
DestroyerFn destroyer
 

Detailed Description

Definition at line 98 of file qsharedpointer_impl.h.

Member Typedef Documentation

◆ DestroyerFn

typedef void(* QtSharedPointer::ExternalRefCountData::DestroyerFn) (ExternalRefCountData *)

Definition at line 100 of file qsharedpointer_impl.h.

Constructor & Destructor Documentation

◆ ExternalRefCountData() [1/2]

QtSharedPointer::ExternalRefCountData::ExternalRefCountData ( DestroyerFn  d)
inline

Definition at line 105 of file qsharedpointer_impl.h.

References QBasicAtomicInteger< T >::storeRelaxed(), strongref, and weakref.

+ Here is the call graph for this function:

◆ ExternalRefCountData() [2/2]

QtSharedPointer::ExternalRefCountData::ExternalRefCountData ( Qt::Initialization  )
inline

Definition at line 111 of file qsharedpointer_impl.h.

◆ ~ExternalRefCountData()

QtSharedPointer::ExternalRefCountData::~ExternalRefCountData ( )
inline

Definition at line 112 of file qsharedpointer_impl.h.

References QBasicAtomicInteger< T >::loadRelaxed(), Q_ASSERT, strongref, and weakref.

+ Here is the call graph for this function:

Member Function Documentation

◆ checkQObjectShared() [1/2]

void QtSharedPointer::ExternalRefCountData::checkQObjectShared (   ...)
inline

Definition at line 121 of file qsharedpointer_impl.h.

◆ checkQObjectShared() [2/2]

void QtSharedPointer::ExternalRefCountData::checkQObjectShared ( const QObject )

This function is called when a QSharedPointer is created from a QWeakPointer

We check that the QWeakPointer was really created from a QSharedPointer, and not from a QObject.

Definition at line 1397 of file qsharedpointer.cpp.

References qWarning.

◆ destroy()

void QtSharedPointer::ExternalRefCountData::destroy ( )
inline

Definition at line 114 of file qsharedpointer_impl.h.

References destroyer.

Referenced by QtSharedPointer::ExternalRefCountWithContiguousData< T >::create().

+ Here is the caller graph for this function:

◆ getAndRef()

QtSharedPointer::ExternalRefCountData * QtSharedPointer::ExternalRefCountData::getAndRef ( const QObject obj)
static

Definition at line 1403 of file qsharedpointer.cpp.

References d, QObjectPrivate::get(), Q_ASSERT, Q_ASSERT_X, QBasicAtomicInteger< T >::ref(), ret, Qt::Uninitialized, and weakref.

Referenced by QV4::QV4QPointer< T >::init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator delete() [1/2]

void QtSharedPointer::ExternalRefCountData::operator delete ( void ,
void  
)
inline

Definition at line 131 of file qsharedpointer_impl.h.

◆ operator delete() [2/2]

void QtSharedPointer::ExternalRefCountData::operator delete ( void ptr)
inline

Definition at line 130 of file qsharedpointer_impl.h.

References ptr().

+ Here is the call graph for this function:

◆ operator new() [1/2]

void * QtSharedPointer::ExternalRefCountData::operator new ( std::size_t  )
inlinedelete

◆ operator new() [2/2]

void * QtSharedPointer::ExternalRefCountData::operator new ( std::size_t  ,
void ptr 
)
inlinenoexcept

Definition at line 129 of file qsharedpointer_impl.h.

References ptr().

+ Here is the call graph for this function:

◆ setQObjectShared() [1/2]

void QtSharedPointer::ExternalRefCountData::setQObjectShared (   ...)
inline

Definition at line 122 of file qsharedpointer_impl.h.

◆ setQObjectShared() [2/2]

QT_BEGIN_NAMESPACE void QtSharedPointer::ExternalRefCountData::setQObjectShared ( const QObject ,
bool  enable 
)

This function is called for a just-created QObject obj, to enable the use of QSharedPointer and QWeakPointer in the future.

Definition at line 1387 of file qsharedpointer.cpp.

Referenced by QSharedPointer< T >::internalConstruct().

+ Here is the caller graph for this function:

Member Data Documentation

◆ destroyer

DestroyerFn QtSharedPointer::ExternalRefCountData::destroyer

Definition at line 103 of file qsharedpointer_impl.h.

Referenced by destroy().

◆ strongref

◆ weakref


The documentation for this struct was generated from the following files: