44#include <StormByte/type_traits/safe.hxx>
52#include <StormByte/safe/pointers.hxx>
53#include <StormByte/type_traits.hxx>
164 template<
typename In,
typename Out>
170 AttachIoIn(std::forward<In>(in));
171 AttachIoOut(std::forward<Out>(out));
180 template<
typename Out>
184 AttachIoOut(std::forward<Out>(out));
194 template<
typename In>
198 AttachIoIn(std::forward<In>(in));
207 template<
typename In,
typename Out>
257 bool EoF() const noexcept;
332 void CacheReadTelemetry() noexcept;
340 void CacheWriteTelemetry() noexcept;
345 void ReleaseTips() noexcept;
351 bool SourceEoF() const noexcept;
367 IO::Result Push(
FIFO& src);
374 template<typename In>
378 std::forward<In>(in));
379 CacheReadTelemetry();
387 template<
typename Out>
390 std::forward<Out>(out));
391 CacheWriteTelemetry();
397 ReadOnly* m_ext_in {
nullptr};
401 WriteOnly* m_ext_out {
nullptr};
405 StormByte::Safe::Unique<IO::BufferedReader> m_io_in;
409 StormByte::Safe::Unique<IO::BufferedWriter> m_io_out;
413 StormByte::Safe::Shared<StormByte::Buffer::ReadTelemetry> m_owned_read;
417 StormByte::Safe::Shared<StormByte::Buffer::WriteTelemetry> m_owned_write;
421 bool m_io_in_blocking {
false};
426 using SessionState =
enum State;
431 SessionState m_session_state {SessionState::Open};
435 mutable std::mutex m_mutex;
Manual bridge between two StormByte-Buffer ends.
Definition bridge.hxx:129
const StormByte::Safe::Shared< StormByte::Buffer::WriteTelemetry > WriteTelemetry() const noexcept
Write counters.
Bridge(In &&, Out &&)=delete
Reject borrowed or const IO leaves instead of falling back to borrowed tips.
const StormByte::Safe::Shared< StormByte::Buffer::ReadTelemetry > ReadTelemetry() const noexcept
Read counters.
bool Failed() const noexcept
Whether a tip has failed for real.
Bridge(ReadOnly &in, WriteOnly &out)
Two non-IO tips.
bool EoF() const noexcept
Whether the read tip reports end-of-stream.
Operation
Read-side wait policy for Passthrough.
Definition bridge.hxx:135
Bridge(const Bridge &)=delete
Copy construction is disabled for one-shot sessions.
Bridge(Bridge &&other) noexcept
Move constructor.
void Close() noexcept
Release owned tips.
bool InputPullBlocking() const noexcept
Whether Pumper must Blocking-pull this source.
State
Session lifetime.
Definition bridge.hxx:144
STORMBYTE_FORCE_INLINE Bridge(In &&in, Out &&out)
Two IO leaves.
Definition bridge.hxx:165
bool InputIsIO() const noexcept
Whether the read tip is a stolen IO leaf.
~Bridge() noexcept
Destructor.
StormByte::ByteSize Passthrough(StormByte::ByteSize n, Operation operation=Operation::Blocking)
Move bytes from the read tip to the write tip.
STORMBYTE_FORCE_INLINE Bridge(ReadOnly &in, Out &&out)
Non-IO source, IO sink stolen.
Definition bridge.hxx:181
STORMBYTE_FORCE_INLINE Bridge(In &&in, WriteOnly &out)
IO source stolen, non-IO sink.
Definition bridge.hxx:195
Byte-oriented FIFO buffer with grow-on-demand and close/error support.
Definition fifo.hxx:86
Coordinated binary read source with optional prefetch and cache.
Definition buffered_reader.hxx:214
Coordinated binary write sink with optional chunked write-behind and a delayed-seek page map.
Definition buffered_writer.hxx:234
Buffer that can be read and not written.
Definition generic.hxx:220
Buffer that can be written and not read.
Definition generic.hxx:497
static Unique< T > MakePointer(Args &&... args)
STORMBYTE_DECLARE_MAYBE_SAFE(class StormByte::System::Device::Access)
Buffered binary sources and sinks.
State
Session state of a coordinated reader or writer.
Definition typedefs.hxx:105
Buffer module of the StormByte suite.
@ Closed
Queue, Sink or budget closed.
Definition byte_budget.hxx:84
Root namespace of the StormByte C++ suite.
#define STORMBYTE_BUFFER_PUBLIC
Definition visibility.h:54