![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#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 113 of file qfreelist_p.h.
|
inlineconstexpr |
Definition at line 174 of file qfreelist_p.h.
Definition at line 181 of file qfreelist_p.h.
|
inline |
Definition at line 188 of file qfreelist_p.h.
|
inline |
Definition at line 202 of file qfreelist_p.h.
|
inline |
Definition at line 195 of file qfreelist_p.h.
|
inline |
Definition at line 233 of file qfreelist_p.h.