diff --git a/core/coresignal.h b/core/coresignal.h index c58a42d803..92912f9fc2 100644 --- a/core/coresignal.h +++ b/core/coresignal.h @@ -52,7 +52,7 @@ class CoreSignal { } // Calls all connected slots. - void emit(Args... args) { + void emit(Args... args) const { if (!_is_enabled) { return; } @@ -77,7 +77,7 @@ class CoreSignal { _is_enabled = true; } - bool is_enabled() { + bool is_enabled() const { return _is_enabled; } diff --git a/core/timermanager.h b/core/timermanager.h index a8bfd5d731..37e014476d 100644 --- a/core/timermanager.h +++ b/core/timermanager.h @@ -102,7 +102,7 @@ typedef struct TimerInfo { // Custom comparator for sorting our timer queue in ascending order class MyGtComparator { public: - bool operator()(const std::shared_ptr& l, const std::shared_ptr& r) { + bool operator()(const std::shared_ptr& l, const std::shared_ptr& r) const { return l.get()->timeout_ns > r.get()->timeout_ns || (l.get()->timeout_ns == r.get()->timeout_ns && l.get()->id > r.get()->id); } @@ -128,7 +128,7 @@ class TimerManager { } // return current virtual time in nanoseconds - uint64_t current_time_ns() { return get_time_now(); } + uint64_t current_time_ns() const { return get_time_now(); } // creating and cancelling timers uint32_t add_absolute_timer(uint64_t timeout_ns, uint64_t interval, timer_cb cb);