-
Notifications
You must be signed in to change notification settings - Fork 0
/
Exception.cpp
43 lines (37 loc) · 928 Bytes
/
Exception.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "Exception.h"
namespace Tinker{
bool Exception::_exceptionThrown = false;
Exception::Type Exception::_type = Exception::None;
Exception::time_type Exception::_time = 0;
Exception::string_type Exception::_message = "";
void Exception::throwException(Type type, string_type& message){
_time = millis();
_type = type;
_message = message;
_exceptionThrown = true;
}
void Exception::throwException(Type type, const char* message){
_time = millis();
_type = type;
_message = String(message);
_exceptionThrown = true;
}
bool Exception::exceptionThrown(){
return _exceptionThrown;
}
void Exception::reset(){
_exceptionThrown = false;
_message = String("");
_type = None;
_time = 0;
}
Exception::Type Exception::type(){
return _type;
}
Exception::time_type Exception::time(){
return _time;
}
const Exception::string_type& Exception::message(){
return _message;
}
}