|
CeresEngine 0.2.0
A game development framework
|
An adapter stream that turns an DataStream into an AsyncDataStream.
More...
#include <CeresEngine/Foundation/IO/Stream.hpp>
Public Member Functions | |
| SyncDataStreamAdapter (DataStream dataStream, ExecutionContext &executionContext) | |
| bool | isSeekable (const Seek mode=Seek::Start) const noexcept final |
| Checks if the stream is seekable. | |
| Async | seek (std::streamsize position, Seek mode=Seek::Start) final |
| Changes the position of the data stream. | |
| bool | isTellable () const noexcept final |
| Checks if the stream knows the size of the data. | |
| Async< size_t > | tell () final |
| Gets the number of bytes available on the stream. | |
| bool | isSizeKnown () const noexcept final |
| Checks if the stream knows the size of the data. | |
| Async< size_t > | size () final |
| Gets the number of bytes available on the stream. | |
| bool | isReadable () const noexcept final |
| Checks if the stream is readable. | |
| Async< size_t > | read (void *data, size_t n) final |
Reads data from the data stream to a buffer of raw memory data with length n. | |
| bool | isWritable () const noexcept final |
| Checks if the stream is writable. | |
| Async< size_t > | write (const void *data, size_t n) final |
Writes data tp the data stream from a buffer of raw memory data with length n. | |
| Async | wait () final |
| Waits until all pending operations on the stream are complete. | |
Public Member Functions inherited from CeresEngine::IAsyncInputStream | |
| virtual Async< size_t > | readExactly (void *data, size_t n) |
Similar to read(void*, size_t), but ensures that the entire data buffer is filled with exactly n bytes or up to the end of the data stream. | |
Public Member Functions inherited from CeresEngine::IAsyncStream | |
| virtual | ~IAsyncStream ()=default |
| Default virtual destructor. | |
| Async | skip (const size_t n) |
Skips n bytes from the data stream. | |
Public Member Functions inherited from CeresEngine::IAsyncOutputStream | |
| virtual Async< size_t > | writeExactly (void *data, size_t n) |
Similar to write(const void*, size_t), but ensures that the entire data buffer is written with exactly n bytes or up to the end of the data stream. | |
Private Attributes | |
| DataStream | mDataStream |
| ExecutionContext & | mExecutionContext |
Additional Inherited Members | |
Public Types inherited from CeresEngine::IAsyncStream | |
| using | Seek = IStream::Seek |
| An enumeration that describes how a data stream should be seeked. | |
An adapter stream that turns an DataStream into an AsyncDataStream.
|
explicit |
|
inlinefinalvirtualnoexcept |
Checks if the stream is readable.
If this method returns true, read() is safe to be called on this stream.
Reimplemented from CeresEngine::IAsyncInputStream.
|
inlinefinalvirtualnoexcept |
Checks if the stream is seekable.
If this method returns true, seek() is safe to be called on this stream.
Reimplemented from CeresEngine::IAsyncStream.
|
inlinefinalvirtualnoexcept |
Checks if the stream knows the size of the data.
If this method returns true, size() is safe to be called on this stream.
Reimplemented from CeresEngine::IAsyncStream.
|
inlinefinalvirtualnoexcept |
Checks if the stream knows the size of the data.
If this method returns true, tell() is safe to be called on this stream.
Reimplemented from CeresEngine::IAsyncStream.
|
inlinefinalvirtualnoexcept |
Checks if the stream is writable.
If this method returns true, write() is safe to be called on this stream.
Reimplemented from CeresEngine::IAsyncOutputStream.
Reads data from the data stream to a buffer of raw memory data with length n.
isReadable() returns true.| data | The memory location to which read data should be placed. |
| n | The maximum number of bytes to be read from the data stream. |
n. If 0, indicates that the stream has ended. Reimplemented from CeresEngine::IAsyncInputStream.
|
finalvirtual |
Changes the position of the data stream.
isSeekable() returns true.| position | The position to set the data stream to. |
| mode | The mode to change the data stream position. |
Reimplemented from CeresEngine::IAsyncStream.
Gets the number of bytes available on the stream.
isSizeKnown() returns true. Reimplemented from CeresEngine::IAsyncStream.
Gets the number of bytes available on the stream.
isTellable() returns true. Reimplemented from CeresEngine::IAsyncStream.
|
finalvirtual |
Waits until all pending operations on the stream are complete.
Implements CeresEngine::IAsyncStream.
|
finalvirtual |
Writes data tp the data stream from a buffer of raw memory data with length n.
isWritable() returns true.| data | The memory location to which written data should be copied from. |
| n | The maximum number of bytes to be write to the data stream. |
n, in that case the write operation must be repeated to ensure that all data was written. If 0, indicates that the stream has ended. Reimplemented from CeresEngine::IAsyncOutputStream.
|
private |
|
private |