Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Core::GeometryMeshStore Class Reference

Registry store for non-skinned geometry mesh handles. More...

#include <AssetRegistry.h>

Collaboration diagram for Engine::Core::GeometryMeshStore:

Classes

struct  Record
 Stored metadata for one geometry mesh handle slot. More...

Public Member Functions

 GeometryMeshStore (AssetManager *assetManager=nullptr)
 Creates a geometry mesh store backed by an optional asset manager.
void setAssetManager (AssetManager *assetManager)
 Sets the asset manager used when new geometry handles request payload loading.
Assets::GeometryMeshHandle load (const Asset::MeshPath &meshPath)
 Gets or creates a stable handle for a mesh path.
bool isValid (Assets::GeometryMeshHandle handle) const
 Checks whether a geometry mesh handle refers to a live slot in this store.
const Asset::MeshPath * path (Assets::GeometryMeshHandle handle) const
 Returns the authored mesh path for a geometry mesh handle.

Static Private Member Functions

static std::string keyFor (const Asset::MeshPath &meshPath)
 Builds the deduplication key for a mesh source path and mesh name.

Private Attributes

AssetManager * assetManager_ = nullptr
 Optional bridge used to request legacy mesh refs.
std::vector< Record > records_
 Slot storage indexed by GeometryMeshHandle::index.
std::unordered_map< std::string, uint32_t > pathToIndex_
 Deduplication map from keyFor() to slot index.

Detailed Description

Registry store for non-skinned geometry mesh handles.

GeometryMeshStore maps authored mesh paths to stable GeometryMeshHandle values and tracks payload and residency generation counters used by loading systems.

Definition at line 91 of file AssetRegistry.h.

Constructor & Destructor Documentation

◆ GeometryMeshStore()

Engine::Core::GeometryMeshStore::GeometryMeshStore ( AssetManager * assetManager = nullptr)
explicit

Creates a geometry mesh store backed by an optional asset manager.

Parameters
assetManagerAsset manager used to request mesh payload loads, or nullptr for handle-only use.

Member Function Documentation

◆ isValid()

bool Engine::Core::GeometryMeshStore::isValid ( Assets::GeometryMeshHandle handle) const
nodiscard

Checks whether a geometry mesh handle refers to a live slot in this store.

Parameters
handleHandle to validate.
Returns
True when the handle index and generation match a stored record.

◆ keyFor()

std::string Engine::Core::GeometryMeshStore::keyFor ( const Asset::MeshPath & meshPath)
staticnodiscardprivate

Builds the deduplication key for a mesh source path and mesh name.

Parameters
meshPathMesh source path and mesh name.
Returns
Stable string key used by pathToIndex_.

◆ load()

Assets::GeometryMeshHandle Engine::Core::GeometryMeshStore::load ( const Asset::MeshPath & meshPath)
nodiscard

Gets or creates a stable handle for a mesh path.

Parameters
meshPathEngine-relative mesh path and mesh asset name.
Returns
Existing or newly created geometry mesh handle.
Exceptions
std::invalid_argumentwhen meshPath contains an absolute source path.

◆ path()

const Asset::MeshPath * Engine::Core::GeometryMeshStore::path ( Assets::GeometryMeshHandle handle) const
nodiscard

Returns the authored mesh path for a geometry mesh handle.

Parameters
handleHandle to look up.
Returns
Pointer to the stored mesh path, or nullptr when the handle is invalid.

◆ setAssetManager()

void Engine::Core::GeometryMeshStore::setAssetManager ( AssetManager * assetManager)

Sets the asset manager used when new geometry handles request payload loading.

Parameters
assetManagerAsset manager to use, or nullptr to disable payload load requests.

Member Data Documentation

◆ assetManager_

AssetManager* Engine::Core::GeometryMeshStore::assetManager_ = nullptr
private

Optional bridge used to request legacy mesh refs.

Definition at line 147 of file AssetRegistry.h.

◆ pathToIndex_

std::unordered_map<std::string, uint32_t> Engine::Core::GeometryMeshStore::pathToIndex_
private

Deduplication map from keyFor() to slot index.

Definition at line 149 of file AssetRegistry.h.

◆ records_

std::vector<Record> Engine::Core::GeometryMeshStore::records_
private

Slot storage indexed by GeometryMeshHandle::index.

Definition at line 148 of file AssetRegistry.h.


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Asset/AssetRegistry.h