EventException.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // EventException.h
  3. //
  4. // Library: XML
  5. // Package: DOM
  6. // Module: DOMEvents
  7. //
  8. // Definition of the DOM EventException class.
  9. //
  10. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef DOM_EventException_INCLUDED
  16. #define DOM_EventException_INCLUDED
  17. #include "Poco/XML/XML.h"
  18. #include "Poco/XML/XMLException.h"
  19. namespace Poco {
  20. namespace XML {
  21. class XML_API EventException: public XMLException
  22. /// Event operations may throw an EventException as
  23. /// specified in their method descriptions.
  24. {
  25. public:
  26. enum
  27. {
  28. UNSPECIFIED_EVENT_TYPE_ERR = 0 /// If the Event's type was not specified by initializing the
  29. /// event before the method was called. Specification of the Event's
  30. /// type as null or an empty string will also trigger this exception.
  31. };
  32. EventException(int code);
  33. /// Creates an EventException with the given error code.
  34. EventException(const EventException& exc);
  35. /// Creates an EventException by copying another one.
  36. ~EventException() noexcept;
  37. /// Destroys the EventException.
  38. EventException& operator = (const EventException& exc);
  39. const char* name() const noexcept;
  40. /// Returns a static string describing the exception.
  41. const char* className() const noexcept;
  42. /// Returns the name of the exception class.
  43. unsigned short code() const;
  44. /// Returns the Event exception code.
  45. protected:
  46. Poco::Exception* clone() const;
  47. private:
  48. EventException();
  49. };
  50. //
  51. // inlines
  52. //
  53. inline unsigned short EventException::code() const
  54. {
  55. return UNSPECIFIED_EVENT_TYPE_ERR;
  56. }
  57. } } // namespace Poco::XML
  58. #endif // DOM_EventException_INCLUDED