CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::PipeInputStream Class Reference

An input stream that allows reading data written by the paired PipeOutputStream. More...

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

Inheritance diagram for CeresEngine::PipeInputStream:
CeresEngine::PipeStream CeresEngine::IInputStream CeresEngine::IStream CeresEngine::IStream

Public Member Functions

 PipeInputStream (PipeInputStream &&) noexcept=default
 
 ~PipeInputStream () noexcept
 
bool isReadable () const noexcept final
 Checks if the stream is readable.
 
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.
 
 PipeStream (const PipeStream &)=delete
 
 PipeStream (PipeStream &&) noexcept
 
bool isSeekable (Seek mode=Seek::Start) const noexcept final
 Checks if the stream is seekable.
 
bool isTellable () const noexcept final
 Checks if the stream knows it's current absolute position.
 
bool isSizeKnown () const noexcept final
 Checks if the stream knows the size of the data.
 
- Public Member Functions inherited from CeresEngine::PipeStream
 PipeStream (const PipeStream &)=delete
 
PipeStreamoperator= (const PipeStream &)=delete
 
 PipeStream (PipeStream &&) noexcept
 
PipeStreamoperator= (PipeStream &&) noexcept=delete
 
bool isSeekable (Seek mode=Seek::Start) const noexcept final
 Checks if the stream is seekable.
 
bool isTellable () const noexcept final
 Checks if the stream knows it's current absolute position.
 
bool isSizeKnown () const noexcept final
 Checks if the stream knows the size of the data.
 
- Public Member Functions inherited from CeresEngine::IStream
 IStream ()=default
 
 IStream (const IStream &) noexcept=delete
 
IStreamoperator= (const IStream &) noexcept=delete
 
 IStream (IStream &&) noexcept=default
 
IStreamoperator= (IStream &&) noexcept=default
 
virtual ~IStream () noexcept=default
 
virtual void seek (std::streamsize position, Seek mode=Seek::Start)
 Changes the position of the data stream.
 
void skip (const size_t n)
 Skips n bytes from the data stream.
 
virtual size_t tell ()
 Gets the absolute stream position, in bytes.
 
virtual size_t size ()
 Gets the number of bytes available on the stream.
 
- Public Member Functions inherited from CeresEngine::IInputStream
template<typename T >
size_t read (const MemoryView< T > &memoryView)
 Reads data from the strea into a memory view.
 
template<typename T >
size_t read (const StridedMemoryView< T > &memoryView)
 Reads data from the stream into a strided memory view.
 
Optional< StringreadString ()
 Reads data from the buffer as a C++ String.
 
template<typename T >
requires std::is_trivially_copyable_v<T>
Optional< Tread ()
 Reads a trivially copyable obhect from the stream.
 
virtual bool invalidate ()
 In the stream is buffered, invalidates any buffered read data from the stream.
 

Additional Inherited Members

- Public Types inherited from CeresEngine::IStream
enum class  Seek { Start = SEEK_SET , Current = SEEK_CUR , End = SEEK_END }
 An enumeration that describes how a data stream should be seeked. More...
 
- Static Public Member Functions inherited from CeresEngine::PipeStream
static Pair< InputStream, OutputStreamopen ()
 Opens a new pair of PipeInputStream and PipeOutputStream.
 
- Protected Attributes inherited from CeresEngine::PipeStream
SPtr< State > mState
 

Detailed Description

An input stream that allows reading data written by the paired PipeOutputStream.

Constructor & Destructor Documentation

◆ PipeInputStream()

CeresEngine::PipeInputStream::PipeInputStream ( PipeInputStream &&  )
defaultnoexcept

◆ ~PipeInputStream()

CeresEngine::PipeInputStream::~PipeInputStream ( )
noexcept

Member Function Documentation

◆ isReadable()

bool CeresEngine::PipeInputStream::isReadable ( ) const
inlinefinalvirtualnoexcept

Checks if the stream is readable.

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

Reimplemented from CeresEngine::IInputStream.

◆ isSeekable()

bool CeresEngine::PipeStream::isSeekable ( Seek  mode = Seek::Start) const
inlinefinalvirtualnoexcept

Checks if the stream is seekable.

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

Reimplemented from CeresEngine::IStream.

◆ isSizeKnown()

bool CeresEngine::PipeStream::isSizeKnown ( ) const
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::IStream.

◆ isTellable()

bool CeresEngine::PipeStream::isTellable ( ) const
inlinefinalvirtualnoexcept

Checks if the stream knows it's current absolute position.

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

Reimplemented from CeresEngine::IStream.

◆ PipeStream() [1/2]

CeresEngine::PipeStream::PipeStream ( const PipeStream )
delete

◆ PipeStream() [2/2]

CeresEngine::PipeStream::PipeStream ( PipeStream &&  )
noexcept

◆ read()

size_t CeresEngine::PipeInputStream::read ( void data,
size_t  n 
)
finalvirtual

Reads data from the data stream to a buffer of raw memory data with length n.

Note
This method is only callable if isReadable() returns true.
Parameters
dataThe memory location to which read data should be placed.
nThe maximum number of bytes to be read from the data stream.
Returns
The number of bytes actually read. Can be smaller than n. If 0, indicates that the stream has ended.

Reimplemented from CeresEngine::IInputStream.


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