CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ResourceObject< T, true > Class Template Reference

Specialization for ResourceObject for types that are final and cannot be extended from. More...

#include <CeresEngine/Resource/Resource.hpp>

Inheritance diagram for CeresEngine::ResourceObject< T, true >:
CeresEngine::TResource< ResourceObject< T > > CeresEngine::Resource CeresEngine::IReflectable

Public Member Functions

virtual CE_DISABLE_WARNING_MISSING_OVERRIDE ::CeresEngine::ClassInfo getClassInfo () noexcept
 
virtual ::CeresEngine::ClassInfo getClassInfo () const noexcept
 
template<typename... Args>
requires (is_explicitly_constructible<T, Args...>)
 ResourceObject (Args &&... args)
 Creates a new instance of the T resource.
 
template<typename... Args>
requires (is_implicitly_constructible<T, Args...>)
 ResourceObject (Args &&... args)
 Creates a new instance of the T resource.
 
template<typename... Args>
 ResourceObject (ResourceData &data, Args &&... args)
 Creates a new instance of the T resource.
 
Tget ()
 The object value.
 
const Tget () const
 The object value.
 
- Public Member Functions inherited from CeresEngine::TResource< ResourceObject< T > >
ResourceHandle< ResourceObject< T > > getResourceHandle () const noexcept
 Generates a hash for the provided type.
 
SPtr< ResourceObject< T > > getShared () noexcept
 Gets a shared pointer to the resource.
 
SPtr< const ResourceObject< T > > getShared () const noexcept
 Gets a shared pointer to the resource.
 
const ResourceTypeInfogetResourceType () 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.
 
ResourceManagergetResourceManager () 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< ResourceMetadatagetResourceMetadata () const noexcept
 A pointer to the user-defined resource metadata.
 
const PackagePtrgetPackage () const noexcept
 The package from which the resource was loaded from.
 
template<typename T = Resource>
SPtr< TgetShared () noexcept
 Gets a shared pointer to the resource.
 
template<typename T = Resource>
SPtr< const TgetShared () 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 Attributes

T mValue
 The object value.
 

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.
 

Detailed Description

template<typename T>
class CeresEngine::ResourceObject< T, true >

Specialization for ResourceObject for types that are final and cannot be extended from.

Constructor & Destructor Documentation

◆ ResourceObject() [1/3]

template<typename T >
template<typename... Args>
requires (is_explicitly_constructible<T, Args...>)
CeresEngine::ResourceObject< T, true >::ResourceObject ( Args &&...  args)
inlineexplicit

Creates a new instance of the T resource.

Parameters
argsThe arguments to be forwarded to T constructor.

◆ ResourceObject() [2/3]

template<typename T >
template<typename... Args>
requires (is_implicitly_constructible<T, Args...>)
CeresEngine::ResourceObject< T, true >::ResourceObject ( Args &&...  args)
inline

Creates a new instance of the T resource.

Parameters
argsThe arguments to be forwarded to T constructor.

◆ ResourceObject() [3/3]

template<typename T >
template<typename... Args>
CeresEngine::ResourceObject< T, true >::ResourceObject ( ResourceData data,
Args &&...  args 
)
inlineexplicit

Creates a new instance of the T resource.

Parameters
dataThe resource data, provided from the resource manager.
argsThe arguments to be forwarded to T constructor.

Member Function Documentation

◆ get() [1/2]

template<typename T >
T & CeresEngine::ResourceObject< T, true >::get ( )
inline

The object value.

◆ get() [2/2]

template<typename T >
const T & CeresEngine::ResourceObject< T, true >::get ( ) const
inline

The object value.

◆ getClassInfo() [1/2]

template<typename T >
virtual ::CeresEngine::ClassInfo CeresEngine::ResourceObject< T, true >::getClassInfo ( ) const
virtualnoexcept

Reimplemented from CeresEngine::Resource.

◆ getClassInfo() [2/2]

Member Data Documentation

◆ mValue

template<typename T >
T CeresEngine::ResourceObject< T, true >::mValue
private

The object value.


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