11#pragma once
22
33#include < cstdint>
4+ #include < functional>
45#include < numeric>
56#include < ranges>
6-
7- #include " sparrow_ipc/output_stream.hpp"
7+ #include < vector>
88
99namespace sparrow_ipc
1010{
1111 /* *
1212 * @brief An output stream that writes data into separate memory chunks.
1313 *
14- * This template class implements an output_stream that stores data in discrete memory chunks
14+ * This template class stores data in discrete memory chunks
1515 * rather than a single contiguous buffer. Each write operation creates a new chunk, making it
1616 * suitable for scenarios where data needs to be processed or transmitted in separate units.
1717 *
@@ -29,7 +29,7 @@ namespace sparrow_ipc
2929 requires std::ranges::random_access_range<R>
3030 && std::ranges::random_access_range<std::ranges::range_value_t <R>>
3131 && std::same_as<typename std::ranges::range_value_t <R>::value_type, uint8_t >
32- class chunked_memory_output_stream final : public output_stream
32+ class chunked_memory_output_stream
3333 {
3434 public:
3535
@@ -51,7 +51,7 @@ namespace sparrow_ipc
5151 * @param count Number of characters to write
5252 * @return Reference to this stream for method chaining
5353 */
54- chunked_memory_output_stream<R>& write (const char * s, std::streamsize count) final ;
54+ chunked_memory_output_stream<R>& write (const char * s, std::streamsize count);
5555
5656 /* *
5757 * @brief Writes a span of bytes as a new chunk.
@@ -61,7 +61,7 @@ namespace sparrow_ipc
6161 * @param span A span of bytes to write as a new chunk
6262 * @return Reference to this stream for method chaining
6363 */
64- chunked_memory_output_stream<R>& write (std::span<const std::uint8_t > span) final ;
64+ chunked_memory_output_stream<R>& write (std::span<const std::uint8_t > span);
6565
6666 /* *
6767 * @brief Writes a buffer by moving it into the chunk container.
@@ -83,7 +83,7 @@ namespace sparrow_ipc
8383 * @param count Number of times to repeat the value
8484 * @return Reference to this stream for method chaining
8585 */
86- chunked_memory_output_stream<R>& write (uint8_t value, std::size_t count) final ;
86+ chunked_memory_output_stream<R>& write (uint8_t value, std::size_t count);
8787
8888 /* *
8989 * @brief Writes a single character as a new chunk.
@@ -93,7 +93,7 @@ namespace sparrow_ipc
9393 * @param value The character value to write
9494 * @return Reference to this stream for method chaining
9595 */
96- chunked_memory_output_stream<R>& put (char value) final ;
96+ chunked_memory_output_stream<R>& put (char value);
9797
9898 /* *
9999 * @brief Reserves capacity in the chunk container.
@@ -103,7 +103,7 @@ namespace sparrow_ipc
103103 *
104104 * @param size Number of chunks to reserve space for
105105 */
106- void reserve (std::size_t size) override ;
106+ void reserve (std::size_t size);
107107
108108 /* *
109109 * @brief Reserves capacity using a lazy calculation function.
@@ -112,7 +112,7 @@ namespace sparrow_ipc
112112 *
113113 * @param calculate_reserve_size Function that returns the number of chunks to reserve
114114 */
115- void reserve (const std::function<std::size_t ()>& calculate_reserve_size) override ;
115+ void reserve (const std::function<std::size_t ()>& calculate_reserve_size);
116116
117117 /* *
118118 * @brief Gets the total size of all chunks.
@@ -121,7 +121,7 @@ namespace sparrow_ipc
121121 *
122122 * @return The total number of bytes across all chunks
123123 */
124- [[nodiscard]] size_t size () const override ;
124+ [[nodiscard]] size_t size () const ;
125125
126126 private:
127127
0 commit comments