## Action #1714

### Revise GTime operators

Status: | Closed | Start date: | 02/25/2016 | |
---|---|---|---|---|

Priority: | Normal | Due date: | ||

Assigned To: | Knödlseder Jürgen | % Done: | 100% | |

Category: | - | |||

Target version: | 1.1.0 | |||

Duration: |

**Description**

It turns out that the current implementation of `GTime`

operators does not make sense, as time is an absolute value, but addition and subtraction should always be relative operations. In addition, multiplication and division operators also do not make much sense for absolute values.

The `GTime`

operators should be modified so that seconds are added or subtracted, or that the subtraction of two `GTime`

objects lead to a difference in seconds. Here the list of operators that should be implemented:

friend GTime operator+(const GTime& time, const double& seconds); friend GTime operator+(const double& seconds, const GTime& time); friend GTime operator-(const GTime& time, const double& seconds); friend double operator-(const GTime& a, const GTime& b); friend bool operator==(const GTime& a, const GTime& b); friend bool operator!=(const GTime& a, const GTime& b); friend bool operator<(const GTime& a, const GTime& b); friend bool operator<=(const GTime& a, const GTime& b); friend bool operator>(const GTime& a, const GTime& b); friend bool operator>=(const GTime& a, const GTime& b); GTime& operator+=(const double& seconds); GTime& operator-=(const double& seconds);

**Recurrence**

No recurrence.

### History

#### #1 Updated by Knödlseder Jürgen about 8 years ago

**Status**changed from*New*to*Closed***% Done**changed from*0*to*100***Remaining (hours)**set to*0.0*

Done and merged into `devel`

.