CppUtils::FileSystem::MeshPager<class Key, class Value>
CLASSDisk-backed pager that persists, tracks, and lazily loads MeshNodePtr graphs via IndexedStorage.
Description
Section titled “Description”| Template parameter | Description |
|---|---|
Key | Branch key type. |
Value | Node payload value type. |
Public types
Section titled “Public types”MeshNodePtr
Section titled “MeshNodePtr”using CppUtils::FileSystem::MeshPager<Key, Value>::MeshNodePtr = Container::MeshNodePtr<Key, Value, Policy>;Public methods
Section titled “Public methods”explicit MeshPager::MeshPager(std::filesystem::path directory, std::optional<std::size_t> maxChunkSize = std::nullopt);Opens or initializes a pager backed by directory.
| Parameter | Description |
|---|---|
directory | Directory where IndexedStorage chunks and index files are stored. |
maxChunkSize | Optional maximum chunk file size in bytes (defaults to 64 MiB). |
Registers node with the pager, assigning a persistent ID and Policy if needed.
| Parameter | Description |
|---|---|
node | Node handle to track. |
Returns: Persistent node ID (or 0 if node is null).
[[nodiscard]] auto MeshPager::acquireFocus(MeshNodePtr node, std::size_t distance = 1) -> ScopedFocus;Tracks node and returns an RAII ScopedFocus keeping its neighborhood up to distance hops in RAM.
| Parameter | Description |
|---|---|
node | Node to keep focused. |
distance | Hop radius around node to preload and retain in memory. |
Returns: ScopedFocus guard that releases the focus on destruction.
Recomputes active focus neighborhoods, loading missing neighbors and unloading out-of-focus nodes.
Synchronizes known persistent link IDs from node’s in-memory branches, assigning IDs to newly linked neighbors.
| Parameter | Description |
|---|---|
node | Loaded node whose outgoing links should be indexed. |
Loads a node by nodeId from disk (or returns the already-loaded instance).
Loaded nodes remain cached in RAM until unloaded explicitly or by a focus update. | Parameter | Description |
| :--- | :--- |
| nodeId | Persistent identifier of the node to load. |
Returns: Loaded MeshNodePtr, or a null handle if nodeId is not found in storage.
Serializes and stores nodeId to disk, then evicts its strong reference from RAM.
| Parameter | Description |
|---|---|
nodeId | Persistent identifier of the node to unload. |