Class storing loading information for resources.
More...
|
typedef std::function< std::unique_ptr< R >) > | Loader |
| Function type to load a resource.
|
|
|
| ResourceLoader (std::function< std::unique_ptr< R >() > loader, std::string id) |
| Constructor. More...
|
|
std::unique_ptr< R > | load () const |
| Loads a resource. More...
|
|
std::string | getInfo () const |
| Returns a string describing the resource loader.
|
|
template<class R>
class thor::ResourceLoader< R >
Class storing loading information for resources.
Constructor.
- Parameters
-
loader | Function returning a unique_ptr<R>. Shall return a unique pointer to the resource if it has been loaded, and nullptr in case of loading failure. The function shall not throw any exceptions. |
id | Identifier which is equal to another identifier if and only if the key refers to the same resource. Can also contain debug information in case of loading failures. |
Loads a resource.
- Returns
- Unique pointer to resource if loaded, nullptr in case of loading failure.
The documentation for this class was generated from the following file: