PageRenderTime 39ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/lib-src/xylon/model/instructions/Error.h

https://bitbucket.org/spamdaemon/xylon
C Header | 62 lines | 29 code | 11 blank | 22 comment | 0 complexity | 57db33027f3e883f46fb56372d3e3a41 MD5 | raw file
Possible License(s): LGPL-2.1
  1. #ifndef _XYLON_MODEL_INSTRUCTIONS_ERROR_H
  2. #define _XYLON_MODEL_INSTRUCTIONS_ERROR_H
  3. #ifndef _XYLON_MODEL_INSTRUCTION_H
  4. #include <xylon/model/Instruction.h>
  5. #endif
  6. namespace xylon {
  7. namespace model {
  8. namespace instructions {
  9. /**
  10. * The Error instruction terminates processing.
  11. */
  12. class Error : public Instruction
  13. {
  14. Error(const Error&);
  15. Error&operator=(const Error&);
  16. /** Default constructor */
  17. protected:
  18. Error() throws();
  19. /** Destructor */
  20. public:
  21. ~Error() throws();
  22. /**
  23. * Create an error instruction
  24. * @return an error instruction
  25. */
  26. public:
  27. static ::timber::Reference< Instruction> create() throws();
  28. /**
  29. * Create an error instruction
  30. * @param errMsg an error message
  31. * @return an error instruction
  32. */
  33. public:
  34. static ::timber::Reference< Instruction> create(const ::std::string& errMsg) throws();
  35. /**
  36. * Accept the specified visitor.
  37. * @param v a visitor
  38. */
  39. public:
  40. void accept(InstructionVisitor& v);
  41. /**
  42. * Get the error message.
  43. * @return an error message
  44. */
  45. public:
  46. virtual const ::std::string& message() const throws() = 0;
  47. };
  48. }
  49. }
  50. }
  51. #endif