@@ -124,23 +124,6 @@ namespace sparrow_ipc
124124 */
125125 [[nodiscard]] size_t size () const ;
126126
127- /* *
128- * @brief Flushes buffered data to the underlying destination.
129- */
130- void flush ();
131-
132- /* *
133- * @brief Closes the stream and releases resources.
134- */
135- void close ();
136-
137- /* *
138- * @brief Checks if the stream is open.
139- *
140- * @return true if open, false otherwise
141- */
142- [[nodiscard]] bool is_open () const ;
143-
144127 /* *
145128 * @brief Gets a reference to the underlying stream cast to the specified type.
146129 *
@@ -177,9 +160,6 @@ namespace sparrow_ipc
177160 virtual void reserve (std::size_t size) = 0;
178161 virtual void reserve (const std::function<std::size_t ()>& calculate_reserve_size) = 0;
179162 [[nodiscard]] virtual size_t size () const = 0;
180- virtual void flush () = 0;
181- virtual void close () = 0;
182- [[nodiscard]] virtual bool is_open () const = 0;
183163 };
184164
185165 /* *
@@ -210,12 +190,6 @@ namespace sparrow_ipc
210190
211191 [[nodiscard]] size_t size () const final ;
212192
213- void flush () final ;
214-
215- void close () final ;
216-
217- [[nodiscard]] bool is_open () const final ;
218-
219193 TStream& get_stream ();
220194
221195 const TStream& get_stream () const ;
@@ -363,41 +337,6 @@ namespace sparrow_ipc
363337 }
364338 }
365339
366- template <typename TStream>
367- void any_output_stream::stream_model<TStream>::flush()
368- {
369- if constexpr (requires (TStream& t) { t.flush (); })
370- {
371- m_stream->flush ();
372- }
373- // If no flush method, do nothing
374- }
375-
376- template <typename TStream>
377- void any_output_stream::stream_model<TStream>::close()
378- {
379- if constexpr (requires (TStream& t) { t.close (); })
380- {
381- m_stream->close ();
382- }
383- // If no close method, do nothing
384- }
385-
386- template <typename TStream>
387- bool any_output_stream::stream_model<TStream>::is_open() const
388- {
389- if constexpr (requires (const TStream& t) {
390- { t.is_open () } -> std::convertible_to<bool >;
391- })
392- {
393- return m_stream->is_open ();
394- }
395- else
396- {
397- return true ; // Assume open if no method available
398- }
399- }
400-
401340 template <typename TStream>
402341 TStream& any_output_stream::stream_model<TStream>::get_stream()
403342 {
0 commit comments