error_info_impl.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //Copyright (c) 2006-2010 Emil Dotchevski and Reverge Stuccos, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef UUID_CE6983AC753411DDA764247956D89593
  5. #define UUID_CE6983AC753411DDA764247956D89593
  6. #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  7. #pragma GCC system_header
  8. #endif
  9. #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  10. #pragma warning(push,1)
  11. #endif
  12. #include <string>
  13. namespace
  14. boost
  15. {
  16. namespace
  17. exception_detail
  18. {
  19. class
  20. error_info_base
  21. {
  22. public:
  23. virtual std::string name_value_string() const = 0;
  24. protected:
  25. virtual
  26. ~error_info_base() throw()
  27. {
  28. }
  29. };
  30. }
  31. template <class Tag,class T>
  32. class
  33. error_info:
  34. public exception_detail::error_info_base
  35. {
  36. public:
  37. typedef T value_type;
  38. error_info( value_type const & value );
  39. ~error_info() throw();
  40. value_type const &
  41. value() const
  42. {
  43. return value_;
  44. }
  45. value_type &
  46. value()
  47. {
  48. return value_;
  49. }
  50. private:
  51. std::string name_value_string() const;
  52. value_type value_;
  53. };
  54. }
  55. #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  56. #pragma warning(pop)
  57. #endif
  58. #endif