* Base class for interrupt exceptions thrown when user * interrupts are detected. */
| 13 | * interrupts are detected. |
| 14 | */ |
| 15 | class interrupt_exception : public std::exception { |
| 16 | public: |
| 17 | /** |
| 18 | * Constructor. |
| 19 | * @param[in] message A description of event that |
| 20 | * caused this exception. |
| 21 | */ |
| 22 | interrupt_exception(std::string message) |
| 23 | : detailed_message(message) |
| 24 | {}; |
| 25 | |
| 26 | /** |
| 27 | * Virtual destructor. Needed to avoid "looser throw specification" errors. |
| 28 | */ |
| 29 | virtual ~interrupt_exception() throw() {}; |
| 30 | |
| 31 | /** |
| 32 | * Obtain a description of the exception. |
| 33 | * @return Description. |
| 34 | */ |
| 35 | virtual const char* what() const throw() { |
| 36 | return detailed_message.c_str(); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * String with details on the error. |
| 41 | */ |
| 42 | std::string detailed_message; |
| 43 | }; |
| 44 | |
| 45 | /** |
| 46 | * Do the actual check for an interrupt. |