You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
5.1 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: unixstl/synch/error/exceptions.hpp
  3. *
  4. * Purpose: Synchronisation API exception(s).
  5. *
  6. * Created: 30th May 2006
  7. * Updated: 10th August 2009
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2006-2009, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. /** \file unixstl/synch/error/exceptions.hpp
  40. *
  41. * \brief [C++ only] Definition of unixstl::synchronisation_exception class
  42. * (\ref group__library__synch "Synchronisation" Library).
  43. */
  44. #ifndef UNIXSTL_INCL_UNIXSTL_SYNCH_ERROR_HPP_EXCEPTIONS
  45. #define UNIXSTL_INCL_UNIXSTL_SYNCH_ERROR_HPP_EXCEPTIONS
  46. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  47. # define UNIXSTL_VER_UNIXSTL_SYNCH_ERROR_HPP_EXCEPTIONS_MAJOR 2
  48. # define UNIXSTL_VER_UNIXSTL_SYNCH_ERROR_HPP_EXCEPTIONS_MINOR 0
  49. # define UNIXSTL_VER_UNIXSTL_SYNCH_ERROR_HPP_EXCEPTIONS_REVISION 1
  50. # define UNIXSTL_VER_UNIXSTL_SYNCH_ERROR_HPP_EXCEPTIONS_EDIT 12
  51. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  52. /* /////////////////////////////////////////////////////////////////////////
  53. * Compatibility
  54. */
  55. /*
  56. [DocumentationStatus:Ready]
  57. */
  58. /* /////////////////////////////////////////////////////////////////////////
  59. * Includes
  60. */
  61. #ifndef UNIXSTL_INCL_UNIXSTL_H_UNIXSTL
  62. # include <unixstl/unixstl.h>
  63. #endif /* !UNIXSTL_INCL_UNIXSTL_H_UNIXSTL */
  64. #ifndef UNIXSTL_INCL_UNIXSTL_HPP_ERROR_UNIX_EXCEPTIONS
  65. # include <unixstl/error/exceptions.hpp>
  66. #endif /* !UNIXSTL_INCL_UNIXSTL_ERROR_HPP_UNIX_EXCEPTIONS */
  67. /* /////////////////////////////////////////////////////////////////////////
  68. * Namespace
  69. */
  70. #ifndef _UNIXSTL_NO_NAMESPACE
  71. # if defined(_STLSOFT_NO_NAMESPACE) || \
  72. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  73. /* There is no stlsoft namespace, so must define ::unixstl */
  74. namespace unixstl
  75. {
  76. # else
  77. /* Define stlsoft::unixstl_project */
  78. namespace stlsoft
  79. {
  80. namespace unixstl_project
  81. {
  82. # endif /* _STLSOFT_NO_NAMESPACE */
  83. #endif /* !_UNIXSTL_NO_NAMESPACE */
  84. /* /////////////////////////////////////////////////////////////////////////
  85. * Classes
  86. */
  87. /** \brief Root exception thrown by
  88. * the \ref group__library__synch "Synchronisation" library.
  89. */
  90. class synchronisation_exception
  91. : public unix_exception
  92. {
  93. /// \name Member Types
  94. /// @{
  95. public:
  96. typedef unix_exception parent_class_type;
  97. typedef synchronisation_exception class_type;
  98. typedef parent_class_type::error_code_type error_code_type;
  99. /// @}
  100. /// \name Construction
  101. /// @{
  102. public:
  103. synchronisation_exception(us_char_a_t const* message, error_code_type error)
  104. : parent_class_type(message, error)
  105. {};
  106. /// @}
  107. /// \name Not to be implemented
  108. /// @{
  109. private:
  110. class_type& operator =(class_type const&);
  111. /// @}
  112. };
  113. ////////////////////////////////////////////////////////////////////////////
  114. // Unit-testing
  115. #ifdef STLSOFT_UNITTEST
  116. # include "./unittest/exceptions_unittest_.h"
  117. #endif /* STLSOFT_UNITTEST */
  118. /* ////////////////////////////////////////////////////////////////////// */
  119. #ifndef _UNIXSTL_NO_NAMESPACE
  120. # if defined(_STLSOFT_NO_NAMESPACE) || \
  121. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  122. } // namespace unixstl
  123. # else
  124. } // namespace unixstl_project
  125. } // namespace stlsoft
  126. # endif /* _STLSOFT_NO_NAMESPACE */
  127. #endif /* !_UNIXSTL_NO_NAMESPACE */
  128. /* ////////////////////////////////////////////////////////////////////// */
  129. #endif /* !UNIXSTL_INCL_UNIXSTL_SYNCH_ERROR_HPP_EXCEPTIONS */
  130. /* ///////////////////////////// end of file //////////////////////////// */