Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QtPrivate::RefCount Class Reference

\inmodule QtCore More...

#include <qrefcount.h>

+ Collaboration diagram for QtPrivate::RefCount:

Public Member Functions

bool ref () noexcept
 
bool deref () noexcept
 
bool isStatic () const noexcept
 
bool isShared () const noexcept
 
void initializeOwned () noexcept
 
void initializeUnsharable () noexcept
 

Public Attributes

QBasicAtomicInt atomic
 

Detailed Description

\inmodule QtCore

QRefCount implements atomic ref counting for Qt's shared classes. It behaves very similar to QAtomicInt, but ignores negative ref counts.

This can be used to allow to implement e.g. const read-only QStringData objects. QString::shared_null and the qs(...) macro make use of this feature.

Definition at line 15 of file qrefcount.h.

Member Function Documentation

◆ deref()

bool QtPrivate::RefCount::deref ( )
inlinenoexcept

Definition at line 25 of file qrefcount.h.

References atomic, QBasicAtomicInteger< T >::deref(), and QBasicAtomicInteger< T >::loadRelaxed().

+ Here is the call graph for this function:

◆ initializeOwned()

void QtPrivate::RefCount::initializeOwned ( )
inlinenoexcept

Definition at line 44 of file qrefcount.h.

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

+ Here is the call graph for this function:

◆ initializeUnsharable()

void QtPrivate::RefCount::initializeUnsharable ( )
inlinenoexcept

Definition at line 45 of file qrefcount.h.

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

+ Here is the call graph for this function:

◆ isShared()

bool QtPrivate::RefCount::isShared ( ) const
inlinenoexcept

Definition at line 38 of file qrefcount.h.

References atomic, and QBasicAtomicInteger< T >::loadRelaxed().

+ Here is the call graph for this function:

◆ isStatic()

bool QtPrivate::RefCount::isStatic ( ) const
inlinenoexcept

Definition at line 32 of file qrefcount.h.

References atomic, and QBasicAtomicInteger< T >::loadRelaxed().

+ Here is the call graph for this function:

◆ ref()

bool QtPrivate::RefCount::ref ( )
inlinenoexcept

Definition at line 18 of file qrefcount.h.

References atomic, QBasicAtomicInteger< T >::loadRelaxed(), and QBasicAtomicInteger< T >::ref().

+ Here is the call graph for this function:

Member Data Documentation

◆ atomic

QBasicAtomicInt QtPrivate::RefCount::atomic

Definition at line 47 of file qrefcount.h.

Referenced by deref(), initializeOwned(), initializeUnsharable(), isShared(), isStatic(), and ref().


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