#define implement_operator(op) \
bool Second::operator op (const Millisecond& other) const \
- throw ()\
+ \
{\
return a_value op (other.a_value / 1000);\
}\
bool Second::operator op (const Microsecond& other) const\
- throw ()\
+ \
{\
return a_value op (other.a_value / 1000000);\
}
Second::Second(const Microsecond& other) : a_value(other.a_value / 1000000) {;}
Second& Second::operator= (const Millisecond & other)
-throw() {
+{
a_value = (other.a_value / 1000);
return *this;
}
Second& Second::operator= (const Microsecond & other)
-throw() {
+{
a_value = (other.a_value / 1000000);
return *this;
}
implement_operator( <)
string Second::asDateTime(const char* format) const
-throw() {
+{
char aux [DateTimeSizeString];
return string(asDateTime(aux, format));
}
const char* Second::asDateTime(char* result, const char* format) const
-throw() {
+{
struct tm* tt = localtime((time_t*) & a_value);
char aux [256];
//static
Second Second::getTime()
-throw() {
+{
struct timeval tv;
gettimeofday(&tv, NULL);
return Second(tv.tv_sec);
//static
Second Second::getLocalTime()
-throw() {
+{
return Second(time(NULL));
}
string Second::asString() const
-throw() {
+{
string result(functions::asString(a_value));
return result += " sec";
}
//static
Second Second::fromString(const std::string& value)
-throw(RuntimeException) {
+noexcept(false) {
if(value.find(" sec") == string::npos) {
string msg("String: ");
msg += value;