Forbid copying, moving; Add overrun getter
This commit is contained in:
parent
fe3e0dd068
commit
2aa529ebf1
@ -1,4 +1,5 @@
|
||||
#include <cmath>
|
||||
#include <ctime>
|
||||
#include <libscerror.hpp>
|
||||
#include "timer.hpp"
|
||||
|
||||
@ -90,3 +91,7 @@ void sc::timer::start(double time, bool repeat) {
|
||||
setup_timer(time, repeat);
|
||||
}
|
||||
}
|
||||
|
||||
int sc::timer::overrun() const {
|
||||
return timer_getoverrun(_tid);
|
||||
}
|
||||
|
@ -26,6 +26,14 @@ namespace sc {
|
||||
void* context = nullptr);
|
||||
~timer();
|
||||
|
||||
// forbid copying
|
||||
timer(const timer&) = delete;
|
||||
timer& operator=(const timer&) = delete;
|
||||
|
||||
// forbid moveing
|
||||
timer(timer&&) = delete;
|
||||
timer& operator=(timer&&) = delete;
|
||||
|
||||
uint64_t id() const { return _id; }
|
||||
double time() const { return _time; }
|
||||
bool repeat() const { return _repeat; }
|
||||
@ -34,6 +42,7 @@ namespace sc {
|
||||
bool is_armed() const;
|
||||
void time_left(struct itimerspec& cur_value) const;
|
||||
double time_left() const;
|
||||
int overrun() const;
|
||||
|
||||
void stop();
|
||||
void start();
|
||||
|
Loading…
x
Reference in New Issue
Block a user