CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ResourceImporterRegistry Class Reference

A registry that keeps track of all resource importers for a ResourceManager. More...

#include <CeresEngine/Resource/Importer/ResourceImporterRegistry.hpp>

Public Member Functions

 ResourceImporterRegistry (ResourceManager &resourceManager)
 Creates a new importer registry.
 
 ~ResourceImporterRegistry ()
 Destroys the importer registry and destroys all importers associated with it.
 
template<typename T , typename... Args>
Tadd (Args &&... args)
 Adds a new resource importer to the registry.
 
ResourceImporteradd (UPtr< ResourceImporter > &&importer)
 Adds a new resource importer to the registry.
 
void remove (const ResourceImporter &importer)
 Removes a previously registered resource importer.
 
Async< ResourceImporter * > get (const ResourceURL &url) const
 Finds an importer suitable for loading the given url.
 

Private Attributes

ResourceManagermResourceManager
 The owning resource manager.
 
Vector< UPtr< ResourceImporter > > mImporters
 A vector that contains all registered importers.
 

Detailed Description

A registry that keeps track of all resource importers for a ResourceManager.

Constructor & Destructor Documentation

◆ ResourceImporterRegistry()

CeresEngine::ResourceImporterRegistry::ResourceImporterRegistry ( ResourceManager resourceManager)
explicit

Creates a new importer registry.

Parameters
resourceManagerThe owning resource manager.

◆ ~ResourceImporterRegistry()

CeresEngine::ResourceImporterRegistry::~ResourceImporterRegistry ( )

Destroys the importer registry and destroys all importers associated with it.

Member Function Documentation

◆ add() [1/2]

template<typename T , typename... Args>
T & CeresEngine::ResourceImporterRegistry::add ( Args &&...  args)
inline

Adds a new resource importer to the registry.

Parameters
importerThe importer to be registered into the registry.
Returns
A reference to the registered importer.

◆ add() [2/2]

ResourceImporter & CeresEngine::ResourceImporterRegistry::add ( UPtr< ResourceImporter > &&  importer)

Adds a new resource importer to the registry.

Parameters
importerThe importer to be registered into the registry.
Returns
A reference to the registered importer.

◆ get()

Async< ResourceImporter * > CeresEngine::ResourceImporterRegistry::get ( const ResourceURL url) const

Finds an importer suitable for loading the given url.

Parameters
urlThe resource URL to be loaded.
Returns
A continuable that returns a suitable importer for loading the given URL, if any exists.

◆ remove()

void CeresEngine::ResourceImporterRegistry::remove ( const ResourceImporter importer)

Removes a previously registered resource importer.

Parameters
importerThe importer to be removed from the registry.

Member Data Documentation

◆ mImporters

Vector<UPtr<ResourceImporter> > CeresEngine::ResourceImporterRegistry::mImporters
private

A vector that contains all registered importers.

◆ mResourceManager

ResourceManager& CeresEngine::ResourceImporterRegistry::mResourceManager
private

The owning resource manager.


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