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

Registry store for skin/skeleton binding handles. More...

#include <AssetRegistry.h>

Collaboration diagram for Engine::Core::SkinStore:

Classes

struct  Record
 Stored metadata for one skin handle slot. More...

Public Member Functions

 SkinStore (AssetManager *assetManager=nullptr)
 Creates a skin store backed by an optional asset manager.
void setAssetManager (AssetManager *assetManager)
 Sets the asset manager used when new skin handles request payload loading.
Assets::SkinHandle load (const Asset::MeshPath &skinPath)
 Gets or creates a stable handle for an authored skin source path.
bool isValid (Assets::SkinHandle handle) const
 Checks whether a skin handle refers to a live slot in this store.
const Asset::MeshPath * path (Assets::SkinHandle handle) const
 Returns the authored skin path for a skin handle.
Assets::Skin * payload (Assets::SkinHandle handle) const
 Resolves a skin handle to its loaded payload behind the manager boundary.

Static Private Member Functions

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

Private Attributes

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

Detailed Description

Registry store for skin/skeleton binding handles.

SkinStore deduplicates authored skin paths (source glTF file plus skin name), returns stable SkinHandle values, and can resolve a handle back to its loaded skin payload.

Definition at line 510 of file AssetRegistry.h.

Constructor & Destructor Documentation

◆ SkinStore()

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

Creates a skin store backed by an optional asset manager.

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

Member Function Documentation

◆ isValid()

bool Engine::Core::SkinStore::isValid ( Assets::SkinHandle handle) const
nodiscard

Checks whether a skin 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::SkinStore::keyFor ( const Asset::MeshPath & skinPath)
staticnodiscardprivate

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

Parameters
skinPathSkin source path and skin name.
Returns
Stable string key used by pathToIndex_.

◆ load()

Assets::SkinHandle Engine::Core::SkinStore::load ( const Asset::MeshPath & skinPath)
nodiscard

Gets or creates a stable handle for an authored skin source path.

Parameters
skinPathEngine-relative source path and skin name.
Returns
Existing or newly created skin handle, or a null handle for an empty path.

◆ path()

const Asset::MeshPath * Engine::Core::SkinStore::path ( Assets::SkinHandle handle) const
nodiscard

Returns the authored skin path for a skin handle.

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

◆ payload()

Assets::Skin * Engine::Core::SkinStore::payload ( Assets::SkinHandle handle) const
nodiscard

Resolves a skin handle to its loaded payload behind the manager boundary.

Parameters
handleHandle to resolve.
Returns
Pointer to the loaded skin, or nullptr when the handle is invalid or not loaded.

◆ setAssetManager()

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

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

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

Member Data Documentation

◆ assetManager_

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

Optional bridge used to request skin refs.

Definition at line 572 of file AssetRegistry.h.

◆ pathToIndex_

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

Deduplication map from keyFor() to slot index.

Definition at line 574 of file AssetRegistry.h.

◆ records_

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

Slot storage indexed by SkinHandle::index.

Definition at line 573 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