Identifies a resource by its type and path CRC32 hashes.
More...
#include <aeongames/ResourceId.hpp>
|
| | ResourceId ()=default |
| | Default constructor.
|
|
| ResourceId (const ResourceId &)=default |
| | Copy constructor.
|
| | ResourceId (uint32_t aType, uint32_t aPath) |
| | Construct from pre-computed CRC32 hashes.
|
| | ResourceId (const std::string &aType, const std::string &aPath) |
| | Construct from type and path strings (hashed internally).
|
| | ResourceId (const std::string &aType, uint32_t aPath) |
| | Construct from a type string and a pre-computed path hash.
|
| | ResourceId (uint32_t aType, const std::string &aPath) |
| | Construct from a pre-computed type hash and a path string.
|
| | operator bool () const |
| | Check whether the identified resource is currently loaded.
|
| uint32_t | GetType () const |
| | Get the CRC32 hash of the resource type.
|
| uint32_t | GetPath () const |
| | Get the CRC32 hash of the resource path.
|
| std::string | GetPathString () const |
| | Get the original resource path string from the hash.
|
| template<typename T> |
| T * | Cast () const |
| | Cast the cached resource to the specified type without loading.
|
| template<typename T> |
| T * | Get () const |
| | Get the resource, loading and caching it if necessary.
|
| void | Store () const |
| | Construct and store the resource in the cache if not already present.
|
| void | Dispose () const |
| | Remove the resource from the cache if present.
|
Identifies a resource by its type and path CRC32 hashes.
Definition at line 29 of file ResourceId.hpp.
◆ ResourceId() [1/5]
| AeonGames::ResourceId::ResourceId |
( |
| ) |
|
|
default |
Default constructor.
Creates an empty resource identifier.
◆ ResourceId() [2/5]
| AeonGames::ResourceId::ResourceId |
( |
uint32_t | aType, |
|
|
uint32_t | aPath ) |
|
inline |
Construct from pre-computed CRC32 hashes.
- Parameters
-
| aType | CRC32 hash of the resource type. |
| aPath | CRC32 hash of the resource path. |
Definition at line 39 of file ResourceId.hpp.
◆ ResourceId() [3/5]
| AeonGames::ResourceId::ResourceId |
( |
const std::string & | aType, |
|
|
const std::string & | aPath ) |
|
inline |
Construct from type and path strings (hashed internally).
- Parameters
-
Definition at line 44 of file ResourceId.hpp.
◆ ResourceId() [4/5]
| AeonGames::ResourceId::ResourceId |
( |
const std::string & | aType, |
|
|
uint32_t | aPath ) |
|
inline |
Construct from a type string and a pre-computed path hash.
- Parameters
-
| aType | Resource type string. |
| aPath | CRC32 hash of the resource path. |
Definition at line 49 of file ResourceId.hpp.
◆ ResourceId() [5/5]
| AeonGames::ResourceId::ResourceId |
( |
uint32_t | aType, |
|
|
const std::string & | aPath ) |
|
inline |
Construct from a pre-computed type hash and a path string.
- Parameters
-
| aType | CRC32 hash of the resource type. |
| aPath | Resource path string. |
Definition at line 54 of file ResourceId.hpp.
◆ Cast()
template<typename T>
| T * AeonGames::ResourceId::Cast |
( |
| ) |
const |
|
inline |
Cast the cached resource to the specified type without loading.
- Template Parameters
-
- Returns
- Pointer to the resource, or nullptr if not cached or wrong type.
Definition at line 90 of file ResourceId.hpp.
◆ Dispose()
| void AeonGames::ResourceId::Dispose |
( |
| ) |
const |
|
inline |
Remove the resource from the cache if present.
Definition at line 120 of file ResourceId.hpp.
◆ Get()
template<typename T>
| T * AeonGames::ResourceId::Get |
( |
| ) |
const |
|
inline |
Get the resource, loading and caching it if necessary.
- Template Parameters
-
- Returns
- Pointer to the resource.
Definition at line 99 of file ResourceId.hpp.
◆ GetPath()
| uint32_t AeonGames::ResourceId::GetPath |
( |
| ) |
const |
|
inline |
Get the CRC32 hash of the resource path.
- Returns
- Path hash.
Definition at line 74 of file ResourceId.hpp.
◆ GetPathString()
| std::string AeonGames::ResourceId::GetPathString |
( |
| ) |
const |
|
inline |
Get the original resource path string from the hash.
- Returns
- Resource path string.
Definition at line 81 of file ResourceId.hpp.
◆ GetType()
| uint32_t AeonGames::ResourceId::GetType |
( |
| ) |
const |
|
inline |
Get the CRC32 hash of the resource type.
- Returns
- Type hash.
Definition at line 67 of file ResourceId.hpp.
◆ operator bool()
| AeonGames::ResourceId::operator bool |
( |
| ) |
const |
|
inline |
Check whether the identified resource is currently loaded.
- Returns
- True if the resource exists in the cache.
Definition at line 60 of file ResourceId.hpp.
◆ Store()
| void AeonGames::ResourceId::Store |
( |
| ) |
const |
|
inline |
Construct and store the resource in the cache if not already present.
Definition at line 110 of file ResourceId.hpp.
The documentation for this class was generated from the following file: