stream_base.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // stream_base.hpp
  3. // ~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2005-2010 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_SSL_STREAM_BASE_HPP
  11. #define ASIO_SSL_STREAM_BASE_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/push_options.hpp"
  16. #include "asio/detail/push_options.hpp"
  17. #include <boost/detail/workaround.hpp>
  18. #include "asio/detail/pop_options.hpp"
  19. namespace asio {
  20. namespace ssl {
  21. /// The stream_base class is used as a base for the asio::ssl::stream
  22. /// class template so that we have a common place to define various enums.
  23. class stream_base
  24. {
  25. public:
  26. /// Different handshake types.
  27. enum handshake_type
  28. {
  29. /// Perform handshaking as a client.
  30. client,
  31. /// Perform handshaking as a server.
  32. server
  33. };
  34. protected:
  35. /// Protected destructor to prevent deletion through this type.
  36. ~stream_base()
  37. {
  38. }
  39. #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
  40. private:
  41. // Workaround to enable the empty base optimisation with Borland C++.
  42. char dummy_;
  43. #endif
  44. };
  45. } // namespace ssl
  46. } // namespace asio
  47. #include "asio/detail/pop_options.hpp"
  48. #endif // ASIO_SSL_STREAM_BASE_HPP