StormByte-Buffer 4.0.0
C++26 buffer module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Buffer::Pipe Class Referencefinal

One transformation in a Pipeline. More...

#include <StormByte/buffer/pipe.hxx>

Public Types

using Callback
 Owned callback with borrowed stream endpoints and logger.

Public Member Functions

 Pipe (Callback callback) noexcept
 Adopt an explicitly provided creator-context callback.
template<typename Callable>
requires (!Type::SameAs<std::remove_cvref_t<Callable>, Pipe>) && Type::CopyConstructible<std::remove_cvref_t<Callable>> && requires(std::remove_cvref_t<Callable>& callable, const PipeInput& input, const PipeOutput& output, const StormByte::Safe::Shared<StormByte::Logger::Log>& log) { { callable(input, output, log) } -> Type::SameAs<void>; }
STORMBYTE_FORCE_INLINE Pipe (Callable &&callable)
 Own a copyable callable in its creator module.
 Pipe (const Pipe &other)
 Copy a Pipe.
 Pipe (Pipe &&other) noexcept
 Take a Pipe.
 ~Pipe () noexcept
 Release context through its creator callback.
Pipe & operator= (const Pipe &other)
 Copy-assign a Pipe.
Pipe & operator= (Pipe &&other) noexcept
 Move-assign a Pipe.
StormByte::Safe::Status Run (const PipeInput &in, const PipeOutput &out, const StormByte::Safe::Shared< StormByte::Logger::Log > &log) const
 Run this pipe.

Detailed Description

One transformation in a Pipeline.

Owns a copyable creator-context callback, not a polymorphic stage. Copies clone the callable and its value captures independently. References and shared handles inside captures retain their normal sharing semantics. Endpoint facades and the logger reference are synchronous borrows only. Close or fail the output before returning. The callable provider, Buffer, Base and Logger must remain loaded with a compatible ABI until release.

Member Typedef Documentation

◆ Callback

Initial value:
Synchronous, non-owning stage input borrow.
Definition pipe.hxx:71
Synchronous, non-owning stage output borrow with const mutation forwarding.
Definition pipe.hxx:115

Owned callback with borrowed stream endpoints and logger.

Constructor & Destructor Documentation

◆ Pipe() [1/4]

StormByte::Buffer::Pipe::Pipe ( Callback callback)
explicitnoexcept

Adopt an explicitly provided creator-context callback.

Parameters
callbackCallback whose provider supplies independent clone and release operations.

◆ Pipe() [2/4]

template<typename Callable>
requires (!Type::SameAs<std::remove_cvref_t<Callable>, Pipe>) && Type::CopyConstructible<std::remove_cvref_t<Callable>> && requires(std::remove_cvref_t<Callable>& callable, const PipeInput& input, const PipeOutput& output, const StormByte::Safe::Shared<StormByte::Logger::Log>& log) { { callable(input, output, log) } -> Type::SameAs<void>; }
STORMBYTE_FORCE_INLINE StormByte::Buffer::Pipe::Pipe ( Callable && callable)
inlineexplicit

Own a copyable callable in its creator module.

Template Parameters
CallableCopyable stage callable type.
Parameters
callableInvoked with input, output and a borrowed scoped logger.
Exceptions
StormByte::ExceptionContext allocation or construction failed.
Note
Force-inlining constructs state in the caller's CRT. Clone and release use matching creator callbacks and Base's heap.

◆ Pipe() [3/4]

StormByte::Buffer::Pipe::Pipe ( const Pipe & other)

Copy a Pipe.

Defined in this module.

Parameters
otherInstance to copy.

◆ Pipe() [4/4]

StormByte::Buffer::Pipe::Pipe ( Pipe && other)
noexcept

Take a Pipe.

Defined in this module.

Parameters
otherInstance to take from.

◆ ~Pipe()

StormByte::Buffer::Pipe::~Pipe ( )
noexcept

Release context through its creator callback.

Member Function Documentation

◆ operator=() [1/2]

Pipe & StormByte::Buffer::Pipe::operator= ( const Pipe & other)

Copy-assign a Pipe.

Defined in this module.

Parameters
otherInstance to copy.
Returns
This Pipe.

◆ operator=() [2/2]

Pipe & StormByte::Buffer::Pipe::operator= ( Pipe && other)
noexcept

Move-assign a Pipe.

Defined in this module.

Parameters
otherInstance to take from.
Returns
This Pipe.

◆ Run()

StormByte::Safe::Status StormByte::Buffer::Pipe::Run ( const PipeInput & in,
const PipeOutput & out,
const StormByte::Safe::Shared< StormByte::Logger::Log > & log ) const

Run this pipe.

Parameters
inSource. Lives for the call.
outSink. Lives for the call. Close or SetError before return.
logShared handle. Empty if the caller passed none. Already scoped Buffer/Pipeline when set.
Returns
Success, Failure for foreign exceptions, or Missing after move.
Exceptions
StormByte::ExceptionSafe exceptions from the callback.

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