mars_lib 0.1.0.2abe2576fe7f
Modular and Robust Sensor-Fusion
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1// Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria.
2//
3// All rights reserved.
4//
5// This software is licensed under the terms of the BSD-2-Clause-License with
6// no commercial use allowed, the full terms of which are made available
7// in the LICENSE file. No license in patents is granted.
8//
9// You can contact the author at <christian.brommer@ieee.org>
10
11#ifndef TIME_H
12#define TIME_H
13
14#include <ctime>
15#include <iostream>
16
17namespace mars
18{
19class Time
20{
21public:
22 Time() = default;
23 Time(const double& seconds);
24
26
27 double get_seconds() const;
28 Time abs() const;
29
30 Time operator+(const Time& rhs) const;
31 Time operator-(const Time& rhs) const;
32 bool operator==(const Time& rhs) const;
33 bool operator<(const Time& rhs) const;
34 bool operator<=(const Time& rhs) const;
35 bool operator>(const Time& rhs) const;
36 bool operator>=(const Time& rhs) const;
37
38 friend std::ostream& operator<<(std::ostream& out, const Time& data);
39
40private:
41 double seconds_{ 0.0 };
42};
43} // namespace mars
44#endif // TIME_H
Definition time.h:20
friend std::ostream & operator<<(std::ostream &out, const Time &data)
bool operator>=(const Time &rhs) const
double seconds_
Definition time.h:41
Time()=default
double get_seconds() const
bool operator==(const Time &rhs) const
static Time get_time_now()
Time abs() const
Time operator-(const Time &rhs) const
bool operator<(const Time &rhs) const
bool operator>(const Time &rhs) const
bool operator<=(const Time &rhs) const
Time operator+(const Time &rhs) const
Time(const double &seconds)
Definition buffer.h:27