CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ResourceImporter Class Referenceabstract

Primary class used to implement parsers and imports for common file formats to engine resources. More...

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

Inheritance diagram for CeresEngine::ResourceImporter:
CeresEngine::TResourceImporter< AudioClip, AudioClipImportOptions > CeresEngine::TResourceImporter< AudioStream, AudioStreamImportOptions > CeresEngine::TResourceImporter< Font, FontImportOptions > CeresEngine::TResourceImporter< MaterialImporter, MaterialImportOptions > CeresEngine::TResourceImporter< Mesh, MeshImportOptions > CeresEngine::TResourceImporter< Scene, SceneImportOptions > CeresEngine::TResourceImporter< ShaderImporter, ShaderImportOptions > CeresEngine::TResourceImporter< Texture, TextureImportOptions > CeresEngine::TResourceImporter< T, O > CeresEngine::TResourceImporter< T, ResourceImportOptions >

Public Types

enum class  SupportStatus { Supported , Generic , Unsupported }
 An enumeration that contains the possible importer support status. More...
 

Public Member Functions

 ResourceImporter (ResourceManager &resourceManager)
 Creates a new resource importer.
 
virtual ~ResourceImporter ()=default
 Destroys the resource importer.
 
virtual Async< ImportedResourcesimport (const ResourceURL &url, const ResourceImportOptions &options)=0
 Imports a resource from a URL.
 
virtual Async< SupportStatussupports (const ResourceURL &url)=0
 Checks if the import supports the given resource.
 

Protected Attributes

ResourceManagermResourceManager
 The owning resource manager.
 
URLSessionmURLSession
 The URL session to be used to load resources.
 
ExecutionContextmExecutionContext
 The execution context to perform asynchronous resource operations on.
 

Detailed Description

Primary class used to implement parsers and imports for common file formats to engine resources.

Member Enumeration Documentation

◆ SupportStatus

An enumeration that contains the possible importer support status.

Enumerator
Supported 

Indicates that the format is supported by the importer.

Generic 

Indicates that the format is supported by the importer, but it uses a generic parser.

If a more suitable importer is supported, it should be used instead.

Unsupported 

The format is unsupported and the importer don't know how to interpret the data.

Constructor & Destructor Documentation

◆ ResourceImporter()

CeresEngine::ResourceImporter::ResourceImporter ( ResourceManager resourceManager)
explicit

Creates a new resource importer.

Parameters
resourceManagerThe owning resource manager.

◆ ~ResourceImporter()

virtual CeresEngine::ResourceImporter::~ResourceImporter ( )
virtualdefault

Destroys the resource importer.

Member Function Documentation

◆ import()

◆ supports()

virtual Async< SupportStatus > CeresEngine::ResourceImporter::supports ( const ResourceURL url)
pure virtual

Checks if the import supports the given resource.

Parameters
urlThe URL to import the resource from.
Returns
A continuable that returns the support status for the given resource URL.

Implemented in CeresEngine::OggVorbisClipImporter, CeresEngine::MTLMaterialImporter, CeresEngine::OBJMeshImporter, CeresEngine::GLTFSceneImporter, CeresEngine::OBJSceneImporter, CeresEngine::StbiTextureImporter, CeresEngine::ShaderImporterImpl, and CeresEngine::DefaultFontImporter.

Member Data Documentation

◆ mExecutionContext

ExecutionContext& CeresEngine::ResourceImporter::mExecutionContext
protected

The execution context to perform asynchronous resource operations on.

◆ mResourceManager

ResourceManager& CeresEngine::ResourceImporter::mResourceManager
protected

The owning resource manager.

Can be used to import/load dependent resources.

◆ mURLSession

URLSession& CeresEngine::ResourceImporter::mURLSession
protected

The URL session to be used to load resources.


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