X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=source%2Fcore%2Futil%2FMillisecond.cpp;fp=source%2Fcore%2Futil%2FMillisecond.cpp;h=8219c35a541fd0a95af40683279ed9bedbc299bb;hp=c24c814d141528334d039b5604e2aa27c7b31f18;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hpb=af9c86ffb0e28d35ad94d99c5f77e41578c972b4 diff --git a/source/core/util/Millisecond.cpp b/source/core/util/Millisecond.cpp index c24c814..8219c35 100644 --- a/source/core/util/Millisecond.cpp +++ b/source/core/util/Millisecond.cpp @@ -20,12 +20,12 @@ using namespace anna; #define implement_operator(op) \ bool Millisecond::operator op (const Second& other) const \ - throw ()\ + \ {\ return a_value op (other.a_value * (type_t)1000);\ }\ bool Millisecond::operator op (const Microsecond& other) const\ - throw ()\ + \ {\ return a_value op (other.a_value / 1000);\ } @@ -35,14 +35,14 @@ Millisecond::Millisecond(const Second& other) : a_value(other.a_value) { a_value Millisecond::Millisecond(const Microsecond& other) : a_value(other.a_value / 1000) {;} Millisecond& Millisecond::operator= (const Second & other) -throw() { +{ a_value = other.a_value; a_value *= (type_t)1000; return *this; } Millisecond& Millisecond::operator= (const Microsecond & other) -throw() { +{ a_value = (other.a_value / 1000); return *this; } @@ -54,7 +54,7 @@ implement_operator( <) //static Millisecond Millisecond::getTime() -throw() { +{ struct timeval tv; gettimeofday(&tv, NULL); Millisecond result(Second(tv.tv_sec)); @@ -64,7 +64,7 @@ throw() { } timeval* Millisecond::getTimeVal(timeval& tv) const -throw() { +{ if(a_value < 0) return NULL; @@ -74,14 +74,14 @@ throw() { } string Millisecond::asString() const -throw() { +{ string result(functions::asString(a_value)); return result += " ms"; } //static Millisecond Millisecond::fromString(const std::string& value) -throw(RuntimeException) { +noexcept(false) { if(value.find(" ms") == string::npos) { string msg("String: "); msg += value;