AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
countdown_timer.h
1#ifndef UTILS_COUNTDOWN_TIMER_H
2#define UTILS_COUNTDOWN_TIMER_H
3
4#include "downward/utils/exceptions.h"
5#include "downward/utils/timer.h"
6
7namespace utils {
8class CountdownTimer {
9 Timer timer;
10 double max_time;
11
12public:
13 explicit CountdownTimer(double max_time);
14 ~CountdownTimer();
15 bool is_expired() const;
16 void throw_if_expired() const;
17 Duration get_elapsed_time() const;
18 Duration get_remaining_time() const;
19 friend std::ostream&
20 operator<<(std::ostream& os, const CountdownTimer& cd_timer);
21};
22
23std::ostream& operator<<(std::ostream& os, const CountdownTimer& cd_timer);
24} // namespace utils
25
26#endif