serial_port_base.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // impl/serial_port_base.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
  7. //
  8. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  9. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  10. //
  11. #ifndef BOOST_ASIO_IMPL_SERIAL_PORT_BASE_HPP
  12. #define BOOST_ASIO_IMPL_SERIAL_PORT_BASE_HPP
  13. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  14. # pragma once
  15. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  16. #include <boost/asio/detail/push_options.hpp>
  17. namespace boost {
  18. namespace asio {
  19. inline serial_port_base::baud_rate::baud_rate(unsigned int rate)
  20. : value_(rate)
  21. {
  22. }
  23. inline unsigned int serial_port_base::baud_rate::value() const
  24. {
  25. return value_;
  26. }
  27. inline serial_port_base::flow_control::type
  28. serial_port_base::flow_control::value() const
  29. {
  30. return value_;
  31. }
  32. inline serial_port_base::parity::type serial_port_base::parity::value() const
  33. {
  34. return value_;
  35. }
  36. inline serial_port_base::stop_bits::type
  37. serial_port_base::stop_bits::value() const
  38. {
  39. return value_;
  40. }
  41. inline unsigned int serial_port_base::character_size::value() const
  42. {
  43. return value_;
  44. }
  45. } // namespace asio
  46. } // namespace boost
  47. #include <boost/asio/detail/pop_options.hpp>
  48. #endif // BOOST_ASIO_IMPL_SERIAL_PORT_BASE_HPP