StormByte C++ Library 0.0.9999
StormByte is a comprehensive, cross-platform C++ library aimed at easing system programming, configuration management, logging, and database handling tasks. This library provides a unified API that abstracts away the complexities and inconsistencies of different platforms (Windows, Linux).
Loading...
Searching...
No Matches
producer.hxx
1#pragma once
2
3#include <StormByte/buffer/shared.hxx>
4#include <memory>
5
18namespace StormByte::Buffer {
40 class STORMBYTE_PUBLIC Producer final {
41 public:
48 Producer() noexcept;
49
50 Producer(const Shared& shared) noexcept;
51
52 Producer(Shared&& shared) noexcept;
53
59 Producer(const Producer& other) = default;
60
66 Producer(Producer&& other) noexcept = default;
67
73 ~Producer() noexcept = default;
74
80 Producer& operator=(const Producer& other) = default;
81
87 Producer& operator=(Producer&& other) noexcept = default;
88
93 Producer& operator<<(const Status& status);
94
100 Producer& operator<<(const Simple& buffer);
101
107 Producer& operator<<(Simple&& buffer);
108
114 Producer& operator<<(const std::string& data);
115
121 Producer& operator<<(const Buffer::Data& data);
122
128 Producer& operator<<(Buffer::Data&& data);
129
139
144 void Lock();
145
150 void Reserve(const std::size_t& size);
151
156 void Unlock();
157
163 Write::Status Write(const Simple& buffer);
164
170 Write::Status Write(Simple&& buffer);
171
177 Write::Status Write(const std::string& data);
178
184 Write::Status Write(const Buffer::Data& data);
185
191 Write::Status Write(Buffer::Data&& data);
192
193 private:
194 std::shared_ptr<Shared> m_shared;
195 };
196}
A read-only interface for accessing a shared buffer.
Definition consumer.hxx:34
A write-only interface for accessing a shared buffer.
Definition producer.hxx:40
Producer() noexcept
Default constructor.
A thread-safe version of the Simple buffer.
Definition shared.hxx:40
A lightweight class for storing and manipulating simple byte buffers.
Definition simple.hxx:37
Namespace for buffer-related components in the StormByte library.
Namespace for write-related utilities in the StormByte library.