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

#include <CeresEngine/Foundation/IO/Stream.hpp>

Inheritance diagram for CeresEngine::IAsyncStream:
CeresEngine::IAsyncInputStream CeresEngine::IAsyncOutputStream CeresEngine::IAsyncDataStream CeresEngine::IAsyncDataStream CeresEngine::SyncDataStreamAdapter CeresEngine::SyncDataStreamAdapter

Public Types

using Seek = IStream::Seek
 An enumeration that describes how a data stream should be seeked.
 

Public Member Functions

virtual ~IAsyncStream ()=default
 Default virtual destructor.
 
virtual bool isSeekable (Seek mode=Seek::Start) const noexcept
 Checks if the stream is seekable.
 
virtual Async seek (std::streamsize position, Seek mode=Seek::Start)
 Changes the position of the data stream.
 
Async skip (const size_t n)
 Skips n bytes from the data stream.
 
virtual bool isTellable () const noexcept
 Checks if the stream knows the size of the data.
 
virtual Async< size_ttell ()
 Gets the number of bytes available on the stream.
 
virtual bool isSizeKnown () const noexcept
 Checks if the stream knows the size of the data.
 
virtual Async< size_tsize ()
 Gets the number of bytes available on the stream.
 
virtual Async wait ()=0
 Waits until all pending operations on the stream are complete.
 

Member Typedef Documentation

◆ Seek

An enumeration that describes how a data stream should be seeked.

Constructor & Destructor Documentation

◆ ~IAsyncStream()

virtual CeresEngine::IAsyncStream::~IAsyncStream ( )
virtualdefault

Default virtual destructor.

Member Function Documentation

◆ isSeekable()

virtual bool CeresEngine::IAsyncStream::isSeekable ( Seek  mode = Seek::Start) const
inlinevirtualnoexcept

Checks if the stream is seekable.

If this method returns true, seek() is safe to be called on this stream.

Reimplemented in CeresEngine::SyncDataStreamAdapter.

◆ isSizeKnown()

virtual bool CeresEngine::IAsyncStream::isSizeKnown ( ) const
virtualnoexcept

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 in CeresEngine::SyncDataStreamAdapter.

◆ isTellable()

virtual bool CeresEngine::IAsyncStream::isTellable ( ) const
inlinevirtualnoexcept

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 in CeresEngine::SyncDataStreamAdapter.

◆ seek()

virtual Async CeresEngine::IAsyncStream::seek ( std::streamsize  position,
Seek  mode = Seek::Start 
)
virtual

Changes the position of the data stream.

Note
This method is only callable if isSeekable() returns true.
Parameters
positionThe position to set the data stream to.
modeThe mode to change the data stream position.

Reimplemented in CeresEngine::SyncDataStreamAdapter.

◆ size()

virtual Async< size_t > CeresEngine::IAsyncStream::size ( )
virtual

Gets the number of bytes available on the stream.

Note
This method is only callable if isSizeKnown() returns true.

Reimplemented in CeresEngine::SyncDataStreamAdapter.

◆ skip()

Async CeresEngine::IAsyncStream::skip ( const size_t  n)
inline

Skips n bytes from the data stream.

◆ tell()

virtual Async< size_t > CeresEngine::IAsyncStream::tell ( )
virtual

Gets the number of bytes available on the stream.

Note
This method is only callable if isTellable() returns true.

Reimplemented in CeresEngine::SyncDataStreamAdapter.

◆ wait()

virtual Async CeresEngine::IAsyncStream::wait ( )
pure virtual

Waits until all pending operations on the stream are complete.

Returns
A continuable that terminates once all operations on the data stream are complete.

Implemented in CeresEngine::SyncDataStreamAdapter.


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