error_info_impl.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, 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. #include <string>
  7. namespace
  8. boost
  9. {
  10. namespace
  11. exception_detail
  12. {
  13. class
  14. error_info_base
  15. {
  16. public:
  17. virtual char const * tag_typeid_name() const = 0;
  18. virtual std::string value_as_string() const = 0;
  19. protected:
  20. virtual
  21. ~error_info_base() throw()
  22. {
  23. }
  24. };
  25. }
  26. template <class Tag,class T>
  27. class
  28. error_info:
  29. public exception_detail::error_info_base
  30. {
  31. public:
  32. typedef T value_type;
  33. error_info( value_type const & value );
  34. ~error_info() throw();
  35. value_type const &
  36. value() const
  37. {
  38. return value_;
  39. }
  40. private:
  41. char const * tag_typeid_name() const;
  42. std::string value_as_string() const;
  43. value_type const value_;
  44. };
  45. }
  46. #endif