4#ifndef _Stroika_Foundation_Streams_SharedMemoryStream_h_
5#define _Stroika_Foundation_Streams_SharedMemoryStream_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
12#include "Stroika/Foundation/Common/Common.h"
22namespace Stroika::Foundation::Streams::SharedMemoryStream {
24 template <
typename ELEMENT_TYPE>
87 template <
typename ELEMENT_TYPE>
89 template <
typename ELEMENT_TYPE,
typename COPY_FROM>
90 Ptr<ELEMENT_TYPE> New (
const COPY_FROM& copyFrom, Options options = {})
91 requires (same_as<ELEMENT_TYPE, byte> and Common::IAnyOf<COPY_FROM,
Memory::BLOB, span<const ELEMENT_TYPE>>);
94 template <
typename ELEMENT_TYPE>
103 template <
typename ELEMENT_TYPE>
112 Ptr (
const Ptr& from) =
default;
113 Ptr (
const shared_ptr<Private_::IRep_<ELEMENT_TYPE>>& from);
116 nonvirtual
Ptr& operator= (
const Ptr& rhs) =
default;
121 nonvirtual
Options GetOptions ()
const;
139 template <
typename T>
140 nonvirtual T
As () const
141 requires (same_as<T, vector<ELEMENT_TYPE>> or (same_as<ELEMENT_TYPE,
byte> and Common::IAnyOf<T, Memory::BLOB,
string>) or
142 (same_as<ELEMENT_TYPE, Characters::
Character> and same_as<T, Characters::String>));
148 nonvirtual const Private_::IRep_<ELEMENT_TYPE>& GetRepConstRef_ () const;
151 friend class SharedMemoryStream;
161#include "SharedMemoryStream.inl"
A Streams::Ptr<ELEMENT_TYPE> is a smart-pointer to a stream of elements of type T.
Options to configure a new SharedMemoryStream; defaults should always work fine, but options can allo...
Execution::InternallySynchronized fInternallySynchronized
controls if the shared stream is automatically synchronized internally so that it can be used by two ...
bool fSeekable
Controls if the SharedMemoryStream maintains history. Doing so allows the Ptr<>::As<> methods to work...