|
CeresEngine 0.2.0
A game development framework
|
Utility template class that can be extended by Resources to automatically implement methods that are deducible from the resource type.
More...
#include <CeresEngine/Resource/Resource.hpp>
Public Member Functions | |
| ResourceHandle< T > | getResourceHandle () const noexcept |
| Generates a hash for the provided type. | |
| SPtr< T > | getShared () noexcept |
| Gets a shared pointer to the resource. | |
| SPtr< const T > | getShared () const noexcept |
| Gets a shared pointer to the resource. | |
| const ResourceTypeInfo & | getResourceType () const noexcept override |
| Returns the resource type information descriptor. | |
| TResource (ResourceData &data, InputStream &dataStream) | |
| void | serialize (OutputStream &dataStream) const override |
Serializes a resource by writing data to dataStream. | |
Public Member Functions inherited from CeresEngine::Resource | |
| Resource () | |
Default constructor for the Resource class. | |
| Resource (ResourceData &data) | |
Creates a new Resource instance by passing a ResourceData instance. | |
| virtual | ~Resource () noexcept=default |
Resource virtual destructor. | |
| ResourceManager * | getResourceManager () const noexcept |
| HResource | getResourceHandle () const noexcept |
| Generates a hash for the provided type. | |
| UUID | getResourceID () const noexcept |
| HResource | getParentResource () const noexcept |
| A parent resource to which this resource is attached to. | |
| SPtr< ResourceMetadata > | getResourceMetadata () const noexcept |
| A pointer to the user-defined resource metadata. | |
| const PackagePtr & | getPackage () const noexcept |
| The package from which the resource was loaded from. | |
| template<typename T = Resource> | |
| SPtr< T > | getShared () noexcept |
| Gets a shared pointer to the resource. | |
| template<typename T = Resource> | |
| SPtr< const T > | getShared () const noexcept |
| Gets a shared pointer to the resource. | |
| Resource (ResourceData &data, InputStream &dataStream) | |
Creates a new resource by reading data from dataStream. | |
Public Member Functions inherited from CeresEngine::IReflectable | |
| virtual | ~IReflectable () noexcept=default |
Private Member Functions | |
| ::CeresEngine::ClassInfo | getClassInfo () noexcept override |
| ::CeresEngine::ClassInfo | getClassInfo () const noexcept override |
Additional Inherited Members | |
Static Public Member Functions inherited from CeresEngine::Resource | |
| template<typename Processor > | |
| static constexpr void | reflect (Processor &&RTTI) |
| Executes the given processor for every field of the struct. | |
Protected Member Functions inherited from CeresEngine::Resource | |
| HResourceStream | createStream (const ResourceStreamFlags &flags=ResourceStreamFlag::Default) |
| Creates a new resource stream. | |
| void | destroyStream (HResourceStream &stream) |
| Destroys a stream. | |
| void | markAsDirty () |
| Marks the resource as dirty. | |
Utility template class that can be extended by Resources to automatically implement methods that are deducible from the resource type.
|
inlineexplicit |
|
inlineoverrideprivatevirtualnoexcept |
|
inlineoverrideprivatevirtualnoexcept |
|
inlinenoexcept |
Generates a hash for the provided type.
Type must have a std::hash specialization.
| T | the type to be hashed |
| v | The value to be hashed |
|
inlineoverridevirtualnoexcept |
Returns the resource type information descriptor.
Implements CeresEngine::Resource.
Reimplemented in CeresEngine::TResource< PBRMaterial, Material >, CeresEngine::TResource< ShaderMaterial, Material >, CeresEngine::TResource< SPIRVShader, Shader >, and CeresEngine::TResource< StreamingMesh, Mesh >.
|
inlinenoexcept |
Gets a shared pointer to the resource.
|
inlinenoexcept |
Gets a shared pointer to the resource.
|
inlineoverridevirtual |
Serializes a resource by writing data to dataStream.
Implements CeresEngine::Resource.
Reimplemented in CeresEngine::TResource< PBRMaterial, Material >, CeresEngine::TResource< ShaderMaterial, Material >, CeresEngine::TResource< SPIRVShader, Shader >, and CeresEngine::TResource< StreamingMesh, Mesh >.