|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <GstHwImportCache.h>
Public Types | |
| using | Deleter = std::function< void(const Key &, Resource &)> |
Public Member Functions | |
| GstHwImportCache (std::size_t capacity, Deleter deleter) | |
| ~GstHwImportCache () | |
| GstHwImportCache (const GstHwImportCache &)=delete | |
| GstHwImportCache & | operator= (const GstHwImportCache &)=delete |
| Resource * | find (const Key &key) |
| void | insert (const Key &key, Resource resource) |
| template<class Pred > | |
| void | eraseIf (Pred pred) |
Erase every entry whose key or resource satisfies pred, deleting each via the configured deleter. | |
| void | clear () |
| bool | empty () const noexcept |
| std::size_t | size () const noexcept |
Bounded LRU cache for GPU import resources (EGLImages, QRhiTexture wrappers). Keyed on a hashable Key; Resource is destroyed via the caller-supplied deleter on eviction, erase and clear. Not internally synchronized — the caller owns whatever locking the resource lifetime requires (DMABuf holds a mutex; the GL path is render-thread-confined).
Definition at line 14 of file GstHwImportCache.h.
| using GstHw::GstHwImportCache< Key, Resource, KeyHash >::Deleter = std::function<void(const Key&, Resource&)> |
Definition at line 17 of file GstHwImportCache.h.
|
inline |
Definition at line 19 of file GstHwImportCache.h.
|
inline |
Definition at line 21 of file GstHwImportCache.h.
References GstHw::GstHwImportCache< Key, Resource, KeyHash >::clear().
|
delete |
|
inline |
Definition at line 75 of file GstHwImportCache.h.
Referenced by GstHw::GstHwImportCache< Key, Resource, KeyHash >::~GstHwImportCache().
|
inlinenoexcept |
Definition at line 84 of file GstHwImportCache.h.
|
inline |
Erase every entry whose key or resource satisfies pred, deleting each via the configured deleter.
Definition at line 62 of file GstHwImportCache.h.
|
inline |
MRU-promoting lookup; returns the stored Resource pointer or nullptr on miss. The pointer is invalidated by the next insert()/eraseIf()/clear() on this cache (a different-key insert can evict it) — never hold it across one.
Definition at line 28 of file GstHwImportCache.h.
|
inline |
Insert (evicting the LRU victim first when at capacity). Replaces any existing entry for key, deleting its old resource. Caller must ensure no live alias to a replaced/evicted resource survives.
Definition at line 40 of file GstHwImportCache.h.
|
delete |
|
inlinenoexcept |
Definition at line 86 of file GstHwImportCache.h.