stream.hpp 903 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // Copyright (c) 2025 Klemens Morgenstern (klemens.morgenstern@gmx.net)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_COBALT_IO_STREAM_HPP
  8. #define BOOST_COBALT_IO_STREAM_HPP
  9. #include <boost/cobalt/io/detail/config.hpp>
  10. #include <boost/cobalt/io/buffer.hpp>
  11. #include <boost/cobalt/io/ops.hpp>
  12. namespace boost::cobalt::io
  13. {
  14. // tag::outline[]
  15. struct BOOST_SYMBOL_VISIBLE write_stream
  16. {
  17. virtual ~write_stream() = default;
  18. [[nodiscard]] virtual write_op write_some(const_buffer_sequence buffer) = 0;
  19. };
  20. struct BOOST_SYMBOL_VISIBLE read_stream
  21. {
  22. virtual ~read_stream() = default;
  23. [[nodiscard]] virtual read_op read_some(mutable_buffer_sequence buffer) = 0;
  24. };
  25. struct stream : read_stream, write_stream
  26. {
  27. };
  28. // end::outline[]
  29. }
  30. #endif //BOOST_COBALT_IO_STREAM_HPP