![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
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>
Public Member Functions | |
~QRhiValueMapper () | |
Q_DISABLE_COPY (QRhiValueMapper) | |
QRhiValueMapper (QRhiValueMapper &&) noexcept=default | |
QRhiValueMapper & | operator= (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> | |
QRhi * | findRhi (Predicate &&p) const |
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.
|
inline |
Definition at line 85 of file qrhivaluemapper_p.h.
References clear().
|
defaultnoexcept |
|
inline |
Definition at line 95 of file qrhivaluemapper_p.h.
|
inline |
Definition at line 127 of file qrhivaluemapper_p.h.
Referenced by ~QRhiValueMapper().
|
inline |
Definition at line 136 of file qrhivaluemapper_p.h.
|
inline |
Definition at line 110 of file qrhivaluemapper_p.h.
|
defaultnoexcept |
QRhiValueMapper< Value >::Q_DISABLE_COPY | ( | QRhiValueMapper< Value > | ) |
|
inline |
Definition at line 98 of file qrhivaluemapper_p.h.