31#ifndef ETL_IN_CHRONO_H
32 #error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
43 template <
typename TClock,
typename TDuration =
typename TClock::duration>
49 using duration = TDuration;
50 using rep =
typename TDuration::rep;
51 using period =
typename TDuration::period;
57 : dur(duration::zero())
64 ETL_CONSTEXPR14
explicit time_point(
const duration& dur_) ETL_NOEXCEPT
80 template <
typename TDuration2>
82 : dur(rhs.time_since_epoch())
209 template <
typename TToDuration,
typename TClock,
typename TDuration>
219 template <
typename TToDuration,
typename TClock,
typename TDuration>
229 template <
typename TToDuration,
typename TClock,
typename TDuration>
236 template <
typename TToDuration,
typename TClock,
typename TDuration>
249 template <
typename TClock,
typename TDuration1,
typename TRep2,
typename TPeriod2>
253 using common_duration =
typename etl::common_type<TDuration1, etl::chrono::duration<TRep2, TPeriod2> >
::type;
256 return result_time_point(lhs.time_since_epoch() + rhs);
263 template <
typename TRep1,
typename TPeriod1,
typename TClock,
typename TDuration2>
267 using common_duration =
typename etl::common_type<etl::chrono::duration<TRep1, TPeriod1>, TDuration2>
::type;
270 return result_time_point(lhs + rhs.time_since_epoch());
277 template <
typename TClock,
typename TDuration1,
typename TRep2,
typename TPeriod2>
281 using common_duration =
typename etl::common_type<TDuration1, etl::chrono::duration<TRep2, TPeriod2> >
::type;
284 return result_time_point(lhs.time_since_epoch() - rhs);
291 template <
typename TClock,
typename TDuration1,
typename TDuration2>
295 return lhs.time_since_epoch() - rhs.time_since_epoch();
301 template <
typename TClock,
typename TDuration1,
typename TDuration2>
304 return lhs.time_since_epoch() == rhs.time_since_epoch();
310 template <
typename TClock,
typename TDuration1,
typename TDuration2>
313 return !(lhs == rhs);
319 template <
typename TClock,
typename TDuration1,
typename TDuration2>
322 return lhs.time_since_epoch() < rhs.time_since_epoch();
328 template <
typename TClock,
typename TDuration1,
typename TDuration2>
337 template <
typename TClock,
typename TDuration1,
typename TDuration2>
346 template <
typename TClock,
typename TDuration1,
typename TDuration2>
357 template <
typename TClock,
typename TDuration1,
typename TDuration2>
362 return (lhs.time_since_epoch() <=> rhs.time_since_epoch());
369 template <
typename TClock,
typename TDuration1,
typename TDuration2>
duration
Definition duration.h:108
Definition time_point.h:45
ETL_NODISCARD ETL_CONSTEXPR14 duration time_since_epoch() const ETL_NOEXCEPT
Definition time_point.h:100
ETL_CONSTEXPR14 time_point(const duration &dur_) ETL_NOEXCEPT
Construct from a duration.
Definition time_point.h:64
ETL_CONSTEXPR14 time_point & operator=(const time_point &rhs) ETL_NOEXCEPT
Assignment operator.
Definition time_point.h:89
ETL_CONSTEXPR time_point() ETL_NOEXCEPT
Default constructor.
Definition time_point.h:56
ETL_CONSTEXPR14 time_point & operator++() ETL_NOEXCEPT
Pre-increments the stored duration by one tick.
Definition time_point.h:128
ETL_CONSTEXPR14 time_point operator--(int) ETL_NOEXCEPT
Post-decrements the stored duration by one tick.
Definition time_point.h:159
static ETL_NODISCARD ETL_CONSTEXPR14 time_point min() ETL_NOEXCEPT
Returns a time_point with the smallest possible duration.
Definition time_point.h:171
ETL_NODISCARD ETL_CONSTEXPR14 int compare(const time_point &other) const ETL_NOEXCEPT
Definition time_point.h:191
static ETL_NODISCARD ETL_CONSTEXPR14 time_point max() ETL_NOEXCEPT
Returns a time_point with the largest possible duration.
Definition time_point.h:180
ETL_CONSTEXPR14 time_point(const time_point< clock, TDuration2 > &rhs) ETL_NOEXCEPT
Copy construct from another time_point with a different duration type.
Definition time_point.h:81
ETL_CONSTEXPR14 time_point(const time_point &rhs) ETL_NOEXCEPT
Copy constructor.
Definition time_point.h:72
ETL_CONSTEXPR14 time_point & operator--() ETL_NOEXCEPT
Pre-decrements the stored duration by one tick.
Definition time_point.h:149
ETL_CONSTEXPR14 time_point & operator-=(const duration &rhs) ETL_NOEXCEPT
Subtracts a duration.
Definition time_point.h:118
ETL_CONSTEXPR14 time_point & operator+=(const duration &rhs) ETL_NOEXCEPT
Adds a duration.
Definition time_point.h:108
ETL_CONSTEXPR14 time_point operator++(int) ETL_NOEXCEPT
Post-increments the stored duration by one tick.
Definition time_point.h:138
ETL_CONSTEXPR14 etl::chrono::day operator+(const etl::chrono::day &d, const etl::chrono::days &ds) ETL_NOEXCEPT
Spaceship operator.
Definition day.h:226
ETL_CONSTEXPR14 etl::chrono::day operator-(const etl::chrono::day &d, const etl::chrono::days &ds) ETL_NOEXCEPT
Definition day.h:252
ETL_CONSTEXPR14 bool operator<(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Less-than operator.
Definition day.h:182
ETL_CONSTEXPR14 bool operator>=(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Greater-than-or-equal operator.
Definition day.h:206
ETL_CONSTEXPR14 bool operator==(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Equality operator.
Definition day.h:166
ETL_CONSTEXPR14 bool operator<=(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Less-than-or-equal operator.
Definition day.h:190
ETL_CONSTEXPR14 bool operator!=(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Inequality operator.
Definition day.h:174
ETL_CONSTEXPR14 bool operator>(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Greater-than operator.
Definition day.h:198
ETL_CONSTEXPR14 TToDuration duration_cast(const etl::chrono::duration< TRep, TPeriod > &d) ETL_NOEXCEPT
duration_cast
Definition duration.h:343
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::time_point< TClock, TToDuration > round(const etl::chrono::time_point< TClock, TDuration > &tp) ETL_NOEXCEPT
Definition time_point.h:230
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::time_point< TClock, TToDuration > floor(const etl::chrono::time_point< TClock, TDuration > &tp) ETL_NOEXCEPT
Rounds down a duration to the nearest lower precision.
Definition time_point.h:210
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::time_point< TClock, TToDuration > ceil(const etl::chrono::time_point< TClock, TDuration > &tp) ETL_NOEXCEPT
Rounds up a duration to the nearest higher precision.
Definition time_point.h:220