Concept Loader

Concept Documentation

template<typename T, typename R>
concept Loader
#include <ResourceManager.hpp>

A concept that defines what a conforming resource loader looks like.

Concept Definition:

template<typename T, typename R>
concept Loader = std::is_base_of_v<Resource, R> && requires(T obj, const std::string& addr) {
        { obj.template FetchData<R>(addr) } -> std::same_as<std::unique_ptr<LoaderIntermediate<T, R>>>;
        { obj.template CreateResource<R>(std::unique_ptr<LoaderIntermediate<T, R>> {}) } -> std::same_as<std::shared_ptr<R>>;
};

These functions should expect to be invoked in the thread pool

tparam T:

The type of the loader object

tparam R:

A Resource type produced by the loader