![]() |
Qt 6.x
The Qt SDK
|
#include <qfreelist_p.h>
Public Member Functions | |
constexpr | QFreeList () |
~QFreeList () | |
ConstReferenceType | at (int x) const |
ReferenceType | operator[] (int x) |
int | next () |
void | release (int id) |
This is a generic implementation of a lock-free free list. Use next() to get the next free entry in the list, and release(id) when done with the id.
This version is templated and allows having a payload of type T which can be accessed using the id returned by next(). The payload is allocated and deallocated automatically by the free list, but NOT when calling next()/release(). Initialization should be done by code needing it after next() returns. Likewise, cleanup() should happen before calling release(). It is possible to have use 'void' as the payload type, in which case the free list only contains indexes to the next free entry.
The ConstantsType type defaults to QFreeListDefaultConstants above. You can define your custom ConstantsType, see above for details on what needs to be available.
Definition at line 111 of file qfreelist_p.h.
|
inlineconstexpr |
Definition at line 171 of file qfreelist_p.h.
Definition at line 178 of file qfreelist_p.h.
References i.
|
inline |
Definition at line 185 of file qfreelist_p.h.
|
inline |
Definition at line 199 of file qfreelist_p.h.
|
inline |
Definition at line 192 of file qfreelist_p.h.
|
inline |
Definition at line 230 of file qfreelist_p.h.
References at.