CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
ResourceImporterRegistry.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
11
14
15namespace CeresEngine {
16
20 private:
23
26
27 public:
30 explicit ResourceImporterRegistry(ResourceManager& resourceManager);
31
35
36 public:
38 template<typename T, typename... Args> T& add(Args&&... args) {
39 return static_cast<T&>(add(ce_unique_new<T>(mResourceManager, std::forward<Args>(args)...)));
40 }
41
47
50 void remove(const ResourceImporter& importer);
51
57 };
58
59} // namespace CeresEngine
Primary class used to implement parsers and imports for common file formats to engine resources.
Definition ResourceImporter.hpp:196
A registry that keeps track of all resource importers for a ResourceManager.
Definition ResourceImporterRegistry.hpp:19
Vector< UPtr< ResourceImporter > > mImporters
A vector that contains all registered importers.
Definition ResourceImporterRegistry.hpp:25
void remove(const ResourceImporter &importer)
Removes a previously registered resource importer.
ResourceImporterRegistry(ResourceManager &resourceManager)
Creates a new importer registry.
T & add(Args &&... args)
Adds a new resource importer to the registry.
Definition ResourceImporterRegistry.hpp:38
Async< ResourceImporter * > get(const ResourceURL &url) const
Finds an importer suitable for loading the given url.
ResourceImporter & add(UPtr< ResourceImporter > &&importer)
Adds a new resource importer to the registry.
~ResourceImporterRegistry()
Destroys the importer registry and destroys all importers associated with it.
ResourceManager & mResourceManager
The owning resource manager.
Definition ResourceImporterRegistry.hpp:22
The ResourceManager is the main class responsible for managing and handling all resources in the engi...
Definition ResourceManager.hpp:47
A Uniform Resource Identifier (URI) is a unique sequence of characters that identifies a logical or p...
Definition URI.hpp:54
Definition Application.hpp:19
std::unique_ptr< T, Deleter > UPtr
UPtr is a smart pointer that owns and manages another object through a pointer and disposes of that o...
Definition SmartPtr.hpp:28
cti::continuable< Args... > Async
Defines a non-copyable continuation type which uses the function2 backend for type erasure.
Definition Async.hpp:22
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25