serial_port_base.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // impl/serial_port_base.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2023 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 ASIO_IMPL_SERIAL_PORT_BASE_HPP
  12. #define 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 "asio/detail/push_options.hpp"
  17. namespace asio {
  18. inline serial_port_base::baud_rate::baud_rate(unsigned int rate)
  19. : value_(rate)
  20. {
  21. }
  22. inline unsigned int serial_port_base::baud_rate::value() const
  23. {
  24. return value_;
  25. }
  26. inline serial_port_base::flow_control::type
  27. serial_port_base::flow_control::value() const
  28. {
  29. return value_;
  30. }
  31. inline serial_port_base::parity::type serial_port_base::parity::value() const
  32. {
  33. return value_;
  34. }
  35. inline serial_port_base::stop_bits::type
  36. serial_port_base::stop_bits::value() const
  37. {
  38. return value_;
  39. }
  40. inline unsigned int serial_port_base::character_size::value() const
  41. {
  42. return value_;
  43. }
  44. } // namespace asio
  45. #include "asio/detail/pop_options.hpp"
  46. #endif // ASIO_IMPL_SERIAL_PORT_BASE_HPP