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
QRhiValueMapper< Value > Class Template Reference

The class associates values of the specified type with different QRhi. One instance of QRhiValueMapper associates one QRhi with one value. The mapped value is deleted when the matching QRhi is cleaned/deleted, when QRhiValueMapper::clear is invoked, or the QRhiValueMapper's instance is deleted. More...

#include <qrhivaluemapper_p.h>

Collaboration diagram for QRhiValueMapper< Value >:

Public Member Functions

 ~QRhiValueMapper ()
 Q_DISABLE_COPY (QRhiValueMapper)
 QRhiValueMapper (QRhiValueMapper &&) noexcept=default
QRhiValueMapperoperator= (QRhiValueMapper &&) noexcept=default
 QRhiValueMapper ()
template<typename V>
std::pair< Value *, bool > tryMap (QRhi &rhi, V &&value)
Value * get (QRhi *rhi) const
void clear ()
template<typename Predicate>
QRhifindRhi (Predicate &&p) const

Detailed Description

template<typename Value>
class QRhiValueMapper< Value >

The class associates values of the specified type with different QRhi. One instance of QRhiValueMapper associates one QRhi with one value. The mapped value is deleted when the matching QRhi is cleaned/deleted, when QRhiValueMapper::clear is invoked, or the QRhiValueMapper's instance is deleted.

QRhiValueMapper's API is thread safe, whereas the objects, which pointers you obtain via QRhiValueMapper::get(), are not. Thus, their thread-safity has to be managed by the code using the mapper.

Note, that QRhiValueMapper destructs the values under its mutex. Keep it in mind and aim to avoid callbacks and signals emissions fror the Value's destructor.

Definition at line 68 of file qrhivaluemapper_p.h.

Constructor & Destructor Documentation

◆ ~QRhiValueMapper()

template<typename Value>
QRhiValueMapper< Value >::~QRhiValueMapper ( )
inline

Definition at line 85 of file qrhivaluemapper_p.h.

References clear().

Here is the call graph for this function:

◆ QRhiValueMapper() [1/2]

template<typename Value>
QRhiValueMapper< Value >::QRhiValueMapper ( QRhiValueMapper< Value > && )
defaultnoexcept

◆ QRhiValueMapper() [2/2]

template<typename Value>
QRhiValueMapper< Value >::QRhiValueMapper ( )
inline

Definition at line 95 of file qrhivaluemapper_p.h.

Member Function Documentation

◆ clear()

template<typename Value>
void QRhiValueMapper< Value >::clear ( )
inline

Definition at line 127 of file qrhivaluemapper_p.h.

Referenced by ~QRhiValueMapper().

Here is the caller graph for this function:

◆ findRhi()

template<typename Value>
template<typename Predicate>
QRhi * QRhiValueMapper< Value >::findRhi ( Predicate && p) const
inline

Definition at line 136 of file qrhivaluemapper_p.h.

◆ get()

template<typename Value>
Value * QRhiValueMapper< Value >::get ( QRhi * rhi) const
inline

Definition at line 110 of file qrhivaluemapper_p.h.

◆ operator=()

template<typename Value>
QRhiValueMapper & QRhiValueMapper< Value >::operator= ( QRhiValueMapper< Value > && )
defaultnoexcept

◆ Q_DISABLE_COPY()

template<typename Value>
QRhiValueMapper< Value >::Q_DISABLE_COPY ( QRhiValueMapper< Value > )

◆ tryMap()

template<typename Value>
template<typename V>
std::pair< Value *, bool > QRhiValueMapper< Value >::tryMap ( QRhi & rhi,
V && value )
inline

Definition at line 98 of file qrhivaluemapper_p.h.


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