|
CeresEngine 0.2.0
A game development framework
|
An object that allows storing side-band data for a resource. More...
#include <CeresEngine/Resource/ResourceStream.hpp>
Public Member Functions | |
| ResourceStreamData (ResourceData &resourceData, const ResourceStreamID &streamID, const ResourceStreamFlags &flags) | |
Creates a new ResourceStreamData for the given resource and with the given stream ID. | |
| virtual | ~ResourceStreamData () noexcept=default |
| Destroys the resource stream data. | |
| virtual Async< ResourceInputStream > | openInputStream ()=0 |
| virtual Async< ResourceOutputStream > | openOutputStream ()=0 |
| bool | isSeekable () const noexcept |
| If defined, indicates that returned stream must be seekable. | |
| bool | isCompressible () const noexcept |
| If defined, will indicate that the stream can be compressed. | |
Public Member Functions inherited from CeresEngine::RefCounted< ResourceStreamData > | |
| RefCounted (Args &&... args) | |
Creates a new RefCounted object and constructs a new Deleter by forwarding Args to it. | |
| void | retain () noexcept |
| Retains the object by increment it's reference count by one. | |
| bool | release () noexcept |
| Relases the object by decrementing it's reference count by one. | |
Public Attributes | |
| ResourceData & | resourceData |
| A handle to the resource that owns the stream. | |
| const ResourceStreamID | streamID |
| The resource stream ID. | |
| const ResourceStreamFlags | flags |
| A set of flags that determine the behavior of the resource stream. | |
Protected Member Functions | |
| auto | acquireReadLock () |
| Asynchronously acquires a read lock on the stream. | |
| auto | acquireWriteLock () |
| Asynchronously acquires a write lock on the stream. | |
Private Attributes | |
| ResourceStreamLockMutex | mMutex |
| A mutex that provides synchronized access to the resource stream. | |
An object that allows storing side-band data for a resource.
This data will not be loaded alongside the resource, but can be read at any time while the resource is loaded.
|
explicit |
Creates a new ResourceStreamData for the given resource and with the given stream ID.
| resource | The resource to create a new stream for. |
| streamID | The stream ID. |
|
virtualdefaultnoexcept |
Destroys the resource stream data.
|
inlineprotected |
Asynchronously acquires a read lock on the stream.
|
inlineprotected |
Asynchronously acquires a write lock on the stream.
|
inlinenoexcept |
If defined, will indicate that the stream can be compressed.
|
inlinenoexcept |
If defined, indicates that returned stream must be seekable.
This can severely limit what the implementations can do. For instance, it may disable compression on the data.
|
pure virtual |
Implemented in CeresEngine::InMemoryResourceStreamData.
|
pure virtual |
Implemented in CeresEngine::InMemoryResourceStreamData.
| const ResourceStreamFlags CeresEngine::ResourceStreamData::flags |
A set of flags that determine the behavior of the resource stream.
|
private |
A mutex that provides synchronized access to the resource stream.
| ResourceData& CeresEngine::ResourceStreamData::resourceData |
A handle to the resource that owns the stream.
| const ResourceStreamID CeresEngine::ResourceStreamData::streamID |
The resource stream ID.
Uniquely identifies the stream on the owning resource.