Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

is_write_buffered.hpp 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // is_write_buffered.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef ASIO_IS_WRITE_BUFFERED_HPP
  11. #define ASIO_IS_WRITE_BUFFERED_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #include "asio/buffered_stream_fwd.hpp"
  17. #include "asio/buffered_write_stream_fwd.hpp"
  18. #include "asio/detail/push_options.hpp"
  19. namespace asio {
  20. namespace detail {
  21. template <typename Stream>
  22. char is_write_buffered_helper(buffered_stream<Stream>* s);
  23. template <typename Stream>
  24. char is_write_buffered_helper(buffered_write_stream<Stream>* s);
  25. struct is_write_buffered_big_type { char data[10]; };
  26. is_write_buffered_big_type is_write_buffered_helper(...);
  27. } // namespace detail
  28. /// The is_write_buffered class is a traits class that may be used to determine
  29. /// whether a stream type supports buffering of written data.
  30. template <typename Stream>
  31. class is_write_buffered
  32. {
  33. public:
  34. #if defined(GENERATING_DOCUMENTATION)
  35. /// The value member is true only if the Stream type supports buffering of
  36. /// written data.
  37. static const bool value;
  38. #else
  39. ASIO_STATIC_CONSTANT(bool,
  40. value = sizeof(detail::is_write_buffered_helper((Stream*)0)) == 1);
  41. #endif
  42. };
  43. } // namespace asio
  44. #include "asio/detail/pop_options.hpp"
  45. #endif // ASIO_IS_WRITE_BUFFERED_HPP