Maze Builder Docs 8.2.1
Loading...
Searching...
No Matches
mazes::resource_management< Resource, Identifier > Class Template Referencefinal

Template class for managing resources. More...

#include <resource_management.h>

Public Member Functions

template<typename Concrete , typename... Args>
void load (Identifier id, Args &&... args)
 Loads a resource of a specific type.
 
void load (Identifier id, std::string_view txt)
 Loads a resource from a string.
 
Resource & get (Identifier id)
 Retrieves a resource by its identifier.
 
const Resource & get (Identifier id) const
 Retrieves a const reference to a resource by its identifier.
 
void clear () noexcept
 Clears all resources from the manager.
 
bool is_empty () const noexcept
 Checks if the resource manager is empty.
 

Detailed Description

template<typename Resource, typename Identifier>
class mazes::resource_management< Resource, Identifier >

Template class for managing resources.

Template Parameters
ResourceThe type of resource to manage
IdentifierThe type used to identify resources

Member Function Documentation

◆ get() [1/2]

template<typename Resource , typename Identifier >
Resource & mazes::resource_management< Resource, Identifier >::get ( Identifier id)

Retrieves a resource by its identifier.

Non-const version of get() to retrieve a resource by its identifier.

Parameters
id
Returns
Template Parameters
Resource
Identifier
Parameters
id
Returns

◆ get() [2/2]

template<typename Resource , typename Identifier >
const Resource & mazes::resource_management< Resource, Identifier >::get ( Identifier id) const

Retrieves a const reference to a resource by its identifier.

Const version of get() to retrieve a resource by its identifier.

Parameters
id
Returns
Template Parameters
Resource
Identifier
Parameters
id
Returns

◆ load() [1/2]

template<typename Resource , typename Identifier >
template<typename Concrete , typename... Args>
void mazes::resource_management< Resource, Identifier >::load ( Identifier id,
Args &&... args )
inline

Loads a resource of a specific type.

Template Parameters
ConcreteThe concrete type of the resource
...ArgsThe types of arguments to pass to the resource constructor
Parameters
idThe identifier for the resource
argsThe arguments to pass to the resource constructor
...argsThe arguments to pass to the resource constructor

◆ load() [2/2]

template<typename Resource , typename Identifier >
void mazes::resource_management< Resource, Identifier >::load ( Identifier id,
std::string_view txt )

Loads a resource from a string.

Parameters
id
txt

The documentation for this class was generated from the following files: