error_categories.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //
  2. // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MYSQL_ERROR_CATEGORIES_HPP
  8. #define BOOST_MYSQL_ERROR_CATEGORIES_HPP
  9. #include <boost/mysql/detail/config.hpp>
  10. #include <boost/system/error_category.hpp>
  11. namespace boost {
  12. namespace mysql {
  13. /**
  14. * \brief Returns the error_category associated to \ref client_errc.
  15. *
  16. * \par Exception safety
  17. * No-throw guarantee.
  18. *
  19. * \par Object lifetimes
  20. * The returned reference is always valid (points to a singleton).
  21. *
  22. * \par Thread safety
  23. * This function is thread-safe.
  24. */
  25. BOOST_MYSQL_DECL
  26. const boost::system::error_category& get_client_category() noexcept;
  27. /**
  28. * \brief Returns the error_category associated to \ref common_server_errc.
  29. *
  30. * \par Exception safety
  31. * No-throw guarantee.
  32. *
  33. * \par Object lifetimes
  34. * The returned reference is always valid (points to a singleton).
  35. *
  36. * \par Thread safety
  37. * This function is thread-safe.
  38. */
  39. BOOST_MYSQL_DECL
  40. const boost::system::error_category& get_common_server_category() noexcept;
  41. /**
  42. * \brief Returns the error_category associated to errors specific to MySQL.
  43. *
  44. * \par Exception safety
  45. * No-throw guarantee.
  46. *
  47. * \par Object lifetimes
  48. * The returned reference is always valid (points to a singleton).
  49. *
  50. * \par Thread safety
  51. * This function is thread-safe.
  52. */
  53. BOOST_MYSQL_DECL
  54. const boost::system::error_category& get_mysql_server_category() noexcept;
  55. /**
  56. * \brief Returns the error_category associated to errors specific to MariaDB.
  57. *
  58. * \par Exception safety
  59. * No-throw guarantee.
  60. *
  61. * \par Object lifetimes
  62. * The returned reference is always valid (points to a singleton).
  63. *
  64. * \par Thread safety
  65. * This function is thread-safe.
  66. */
  67. BOOST_MYSQL_DECL
  68. const boost::system::error_category& get_mariadb_server_category() noexcept;
  69. } // namespace mysql
  70. } // namespace boost
  71. #ifdef BOOST_MYSQL_HEADER_ONLY
  72. #include <boost/mysql/impl/error_categories.ipp>
  73. #endif
  74. #endif