|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
Monotonic allocator for custom (non-Blizzard) FileDataIDs. More...
#include <wowlib/fs/fdid_allocator.hpp>
Public Member Functions | |
| FdidAllocator (FileDataID start=FileDataID{1 '000 '000 '000}, FileDataID max=FileDataID{0xFFFFFFFE}) | |
| Result< FileDataID > | next () |
| Allocate the next id. | |
| void | noteExisting (FileDataID id) |
| Bump the allocator past an id seen in a loaded listfile, so re-opening a project never re-hands-out an id already in use. | |
| FileDataID | peek () const |
| The id the next successful call to next() would return. | |
Monotonic allocator for custom (non-Blizzard) FileDataIDs.
Starts at a configurable point far above Blizzard's allocation (~6-7M as of 2026) so future official content never collides with project files. Pure and single-threaded by itself; the owning listfile provider serializes access under its exclusive lock.
Definition at line 20 of file fdid_allocator.hpp.
|
inlineexplicit |
| start | the first id to hand out. |
| max | the last usable id (inclusive); defaults to just below the u32 ceiling. |
Definition at line 25 of file fdid_allocator.hpp.
|
inline |
Allocate the next id.
Definition at line 30 of file fdid_allocator.hpp.
References wowlib::FdidSpaceExhausted, and wowlib::makeError().
|
inline |
Bump the allocator past an id seen in a loaded listfile, so re-opening a project never re-hands-out an id already in use.
| id | an existing id (only ids inside the custom range move the cursor). |
Definition at line 39 of file fdid_allocator.hpp.
Referenced by wowlib::fs::CsvListfile::load().
|
inline |
The id the next successful call to next() would return.
Definition at line 45 of file fdid_allocator.hpp.