4#ifndef _Stroika_Foundation_Streams_Stream_h_
5#define _Stroika_Foundation_Streams_Stream_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
11#include "Stroika/Foundation/Common/Common.h"
14#include "Stroika/Foundation/Memory/Common.h"
22namespace Stroika::Foundation::Streams {
36 using Whence::eFromCurrent;
37 using Whence::eFromEnd;
38 using Whence::eFromStart;
68 using SeekableFlag::eNotSeekable;
69 using SeekableFlag::eSeekable;
71 template <
typename ELEMENT_TYPE>
105 eDEFAULT [[deprecated (
"Since Stroika v3.0d15 - this value deprecated - use eBlockIfNoDataAvailable or another API")]] =
eBlockIfNoDataAvailable
107 using NoDataAvailableHandling::eBlockIfNoDataAvailable;
108 using NoDataAvailableHandling::eDontBlock;
169 template <
typename ELEMENT_TYPE>
175 Ptr () noexcept = default;
176 Ptr (const
Ptr&) noexcept = default;
177 Ptr (
Ptr&&) noexcept = default;
178 Ptr (nullptr_t) noexcept;
179 Ptr (const shared_ptr<
IRep<ELEMENT_TYPE>>& rep) noexcept;
184 nonvirtual
Ptr& operator= (const
Ptr&) = default;
185 nonvirtual
Ptr& operator= (
Ptr&&) noexcept = default;
193 nonvirtual
void reset () noexcept;
201 nonvirtual
bool operator== (nullptr_t) const;
207 nonvirtual explicit operator
bool () const;
241 return IsSeekable () ? SeekableFlag::eSeekable : SeekableFlag::eNotSeekable;
248 shared_ptr<IRep<ELEMENT_TYPE>> fRep_;
251 bool fSeekable_{
false};
257 template <
typename ELEMENT_TYPE>
260 using ElementType = ELEMENT_TYPE;
267 virtual ~IRep () =
default;
270 nonvirtual
IRep& operator= (
const IRep&) =
delete;
#define Stroika_Define_Enum_Bounds(FIRST_ITEM, LAST_ITEM)
NoDataAvailableHandling
If eDontBlock passed to most Stream APIs, then when the code would do a blocking read,...
@ eBlockIfNoDataAvailable
int64_t SignedSeekOffsetType
NOT a real mutex - just a debugging infrastructure support tool so in debug builds can be assured thr...
virtual bool IsSeekable() const =0
A Streams::Ptr<ELEMENT_TYPE> is a smart-pointer to a stream of elements of type T.
nonvirtual void reset() noexcept
nonvirtual IRep< ELEMENT_TYPE > & GetRepRWRef() const
nonvirtual shared_ptr< IRep< ELEMENT_TYPE > > GetSharedRep() const
access to underlying stream smart pointer
nonvirtual const IRep< ELEMENT_TYPE > & GetRepConstRef() const
nonvirtual bool IsSeekable() const
Returns true iff this object was constructed with a seekable input stream rep.