stream_base.hpp 1.3 KB

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