StormByte C++ Library: Buffer module 1.2.0
StormByte-Buffer is the buffer module of the StormByte C++ suite.
Loading...
Searching...
No Matches
pipeline.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte-Buffer.
5 *
6 * StormByte-Buffer is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License version 3
8 * or later, as published by the Free Software Foundation.
9 *
10 * StormByte-Buffer is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with StormByte-Buffer. If not, see
17 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
18 */
19
20#pragma once
21
26
27#include <functional>
28#include <memory>
29#include <thread>
30#include <vector>
31
36namespace StormByte::Buffer {
41 class LockFreeRing;
42
93 public:
107 using PipeFunction = std::function<void(
110 std::shared_ptr<Logger::Log>
111 )>;
112
121 Pipeline() noexcept;
122
128 Pipeline(const Pipeline& other);
129
134 Pipeline(Pipeline&& other) noexcept;
135
140 ~Pipeline() noexcept;
141
147 Pipeline& operator=(const Pipeline& other);
148
154 Pipeline& operator=(Pipeline&& other) noexcept;
155
167 void AddPipe(const PipeFunction& pipe);
168
173 void AddPipe(PipeFunction&& pipe);
174
188 void SetError() const noexcept;
189
205 Consumer Process(Consumer buffer,
206 const ExecutionMode& mode,
207 std::shared_ptr<Logger::Log> log) const noexcept;
208
211 private:
212 struct Impl;
213 std::unique_ptr<Impl> m_impl;
214 };
215}
Read-oriented handle over a shared Ring.
Definition consumer.hxx:53
Abstract interface for reading data from an external or internal source.
Definition external.hxx:55
Abstract interface for writing data to an external or internal sink.
Definition external.hxx:284
High-performance multi-stage data-processing pipeline.
Definition pipeline.hxx:92
std::function< void(ExternalReader &, ExternalWriter &, std::shared_ptr< Logger::Log >)> PipeFunction
Signature of a pipeline stage.
Definition pipeline.hxx:111
Pipeline() noexcept
Default construct an empty pipeline (no stages).
Buffer module of the StormByte suite.
ExecutionMode
Bitmask controlling how Pipeline::Process schedules work.
Definition typedefs.hxx:91
#define STORMBYTE_BUFFER_PUBLIC
Definition visibility.h:28