Skip to content

Loader

Abstract base class for resource loader types.

Not intended for direct use.

Functions

Load() LoaderResult< Resource >

cpp
LoaderResult< Resource > vglx::Loader< Resource >::Load(const fs::path &path) const
ParameterDescription
pathFile system path to the resource.

Loads a resource synchronously from the specified file path. This method verifies that the file exists before attempting to load. If the file is missing or an error occurs during loading, an error message is returned via std::unexpected.

LoadAsync() auto

cpp
auto vglx::Loader< Resource >::LoadAsync(const fs::path &path, LoaderCallback< Resource > callback) const
ParameterDescription
pathFile system path to the resource.
callbackCallback that receives the result of the loading operation.

Loads a resource asynchronously from the specified file path. The result is delivered to the provided callback on a background thread. File existence is verified before loading. This implementation currently spawns a detached thread and should be updated to use a thread pool for better control and efficiency.

Released under the MIT License.