StormByte C++ Library: Buffer module 0.0.9999
StormByte-Buffer is a StormByte library module for handling buffers
Loading...
Searching...
No Matches
pipeline.hxx
1#pragma once
2
3#include <StormByte/buffer/consumer.hxx>
4#include <StormByte/buffer/producer.hxx>
5#include <StormByte/buffer/typedefs.hxx>
6
7#include <thread>
8
17namespace StormByte::Buffer {
74 class STORMBYTE_BUFFER_PUBLIC Pipeline final {
75 public:
80 Pipeline() noexcept = default;
81
87 Pipeline(const Pipeline& other);
88
94 Pipeline(Pipeline&& other) noexcept = default;
95
99 ~Pipeline() noexcept;
100
106 Pipeline& operator=(const Pipeline& other);
107
113 Pipeline& operator=(Pipeline&& other) noexcept = default;
114
122 void AddPipe(const PipeFunction& pipe);
123
130 void AddPipe(PipeFunction&& pipe);
131
142 void SetError() const noexcept;
143
182 Consumer Process(Consumer buffer, const ExecutionMode& mode, std::shared_ptr<Logger::Log> log) const noexcept;
183
184 private:
185 std::vector<PipeFunction> m_pipes;
186 mutable std::vector<Producer> m_producers;
187 mutable std::vector<std::thread> m_threads;
188
193 void WaitForCompletion() const noexcept;
194 };
195}
Read-only interface for consuming data from a shared FIFO buffer.
Definition consumer.hxx:46
Multi-stage data-processing pipeline with optional concurrent execution.
Definition pipeline.hxx:74
Pipeline() noexcept=default
Default constructor Initializes an empty pipeline buffer.
Producer interface for writing data to a shared FIFO buffer.
Definition producer.hxx:27