Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Asset::MeshPath Struct Reference

Identifies a named mesh-like asset inside an asset file. More...

#include <AssetPath.h>

Collaboration diagram for Asset::MeshPath:

Public Member Functions

 MeshPath ()=default
 Creates an empty asset path.
 MeshPath (const std::filesystem::path &path, const std::string &assetName)
 Creates an asset path for a named asset in a file.
 MeshPath (MeshPath &&other) noexcept
 Move-constructs an asset path.
 MeshPath (const MeshPath &other) noexcept
 Copy-constructs an asset path.
MeshPathoperator= (const MeshPath &)=default
 Copy-assigns an asset path.
MeshPathoperator= (MeshPath &&) noexcept=default
 Move-assigns an asset path.
const std::filesystem::path & getFilePath () const
 Gets the source file path.
const std::string & getAssetName () const
 Gets the asset name inside the source file.
std::string getAssetHandle () const
 Gets a combined string key for file path and asset name.
std::size_t hash () const noexcept
 Calculates a hash for use in unordered containers.
bool empty () const
 Checks whether this path doesn't point to anything. So it is empty.
bool operator== (const MeshPath &other) const
 Compares two asset paths by file path and asset name.
void reset ()
 Clears the file path and asset name.

Private Attributes

std::filesystem::path filePath_ = ""
std::string assetName_ = std::string("")

Detailed Description

Identifies a named mesh-like asset inside an asset file.

MeshPath combines the source file path with an asset name from that file. Mesh and material managers use it as a key when several assets are imported from the same glTF file.

Definition at line 40 of file AssetPath.h.

Constructor & Destructor Documentation

◆ MeshPath() [1/4]

Asset::MeshPath::MeshPath ( )
default

Creates an empty asset path.

Referenced by MeshPath(), MeshPath(), operator=(), operator=(), and operator==().

Here is the caller graph for this function:

◆ MeshPath() [2/4]

Asset::MeshPath::MeshPath ( const std::filesystem::path & path,
const std::string & assetName )

Creates an asset path for a named asset in a file.

Parameters
pathSource file that contains the asset.
assetNameName of the asset inside the source file.

◆ MeshPath() [3/4]

Asset::MeshPath::MeshPath ( MeshPath && other)
noexcept

Move-constructs an asset path.

Parameters
otherAsset path to move from.

References MeshPath().

Here is the call graph for this function:

◆ MeshPath() [4/4]

Asset::MeshPath::MeshPath ( const MeshPath & other)
noexcept

Copy-constructs an asset path.

Parameters
otherAsset path to copy from.

References MeshPath().

Here is the call graph for this function:

Member Function Documentation

◆ empty()

bool Asset::MeshPath::empty ( ) const
inlinenodiscard

Checks whether this path doesn't point to anything. So it is empty.

Returns
If the path is empty and doesn't point to anything

Definition at line 103 of file AssetPath.h.

References assetName_, empty(), and filePath_.

Referenced by empty().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAssetHandle()

std::string Asset::MeshPath::getAssetHandle ( ) const
inlinenodiscard

Gets a combined string key for file path and asset name.

Returns
Concatenated file path string and asset name.

Definition at line 91 of file AssetPath.h.

References assetName_, and filePath_.

◆ getAssetName()

const std::string & Asset::MeshPath::getAssetName ( ) const
inlinenodiscard

Gets the asset name inside the source file.

Returns
Asset name component of this key.

Definition at line 85 of file AssetPath.h.

References assetName_.

◆ getFilePath()

const std::filesystem::path & Asset::MeshPath::getFilePath ( ) const
inlinenodiscard

Gets the source file path.

Returns
Filesystem path that contains the named asset.

Definition at line 79 of file AssetPath.h.

References filePath_, and getFilePath().

Referenced by getFilePath().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hash()

std::size_t Asset::MeshPath::hash ( ) const
nodiscardnoexcept

Calculates a hash for use in unordered containers.

Returns
Hash value derived from the file path and asset name.

◆ operator=() [1/2]

MeshPath & Asset::MeshPath::operator= ( const MeshPath & )
default

Copy-assigns an asset path.

References MeshPath().

Here is the call graph for this function:

◆ operator=() [2/2]

MeshPath & Asset::MeshPath::operator= ( MeshPath && )
defaultnoexcept

Move-assigns an asset path.

References MeshPath().

Here is the call graph for this function:

◆ operator==()

bool Asset::MeshPath::operator== ( const MeshPath & other) const
inline

Compares two asset paths by file path and asset name.

Parameters
otherAsset path to compare with.
Returns
True when both are identical.

Definition at line 110 of file AssetPath.h.

References assetName_, filePath_, and MeshPath().

Here is the call graph for this function:

◆ reset()

void Asset::MeshPath::reset ( )

Clears the file path and asset name.

Member Data Documentation

◆ assetName_

std::string Asset::MeshPath::assetName_ = std::string("")
private

Definition at line 121 of file AssetPath.h.

Referenced by empty(), getAssetHandle(), getAssetName(), and operator==().

◆ filePath_

std::filesystem::path Asset::MeshPath::filePath_ = ""
private

Definition at line 120 of file AssetPath.h.

Referenced by empty(), getAssetHandle(), getFilePath(), and operator==().


The documentation for this struct was generated from the following file:
  • /home/magerbeton/Documents/gl3-vulkan/Engine/include/Engine/Files/AssetPath.h