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

A base class for streams that allows reading from a PipeInputStream, all data written to the PipeOutputStream. More...

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

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

Public Member Functions

 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.
 

Static Public Member Functions

static Pair< InputStream, OutputStreamopen ()
 Opens a new pair of PipeInputStream and PipeOutputStream.
 

Protected Attributes

SPtr< State > mState
 

Private Member Functions

 PipeStream (SPtr< State > state)
 Constructs a new stream with an existing state.
 

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...
 

Detailed Description

A base class for streams that allows reading from a PipeInputStream, all data written to the PipeOutputStream.

The stream pair must be opened with open().

Constructor & Destructor Documentation

◆ PipeStream() [1/3]

CeresEngine::PipeStream::PipeStream ( SPtr< State >  state)
explicitprivate

Constructs a new stream with an existing state.

◆ PipeStream() [2/3]

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

◆ PipeStream() [3/3]

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

Member Function Documentation

◆ 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.

◆ open()

static Pair< InputStream, OutputStream > CeresEngine::PipeStream::open ( )
static

Opens a new pair of PipeInputStream and PipeOutputStream.

All data written to the OutputStream will be readable from the InputStream.

◆ operator=() [1/2]

PipeStream & CeresEngine::PipeStream::operator= ( const PipeStream )
delete

◆ operator=() [2/2]

PipeStream & CeresEngine::PipeStream::operator= ( PipeStream &&  )
deletenoexcept

Member Data Documentation

◆ mState

SPtr<State> CeresEngine::PipeStream::mState
protected


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