stream_base.hpp 1.4 KB

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