Rename timer `Setup` function to `Schedule`
This patch was motivated by my desire to fix a typo in the function
name. The noun "setup" is 1 word. The verb "set up" is 2 words. All
other member functions are verbs, so this one should be a verb too.
That means that the function should be called `SetUp`. During the
discussion that resulted from the rename, James Kuszmaul pointed out
that "setting up" a timer can be confusing. It implies that you can
only "set up" a timer once. But the intent is to let users set up
timers as many times as they like. So we decided on renaming the
function to `Schedule`. That conveys the purpose and intent better.
I took this opportunity to fix some other typos involving the verb
"set up".
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I2f557d1f946960af82711f248820d5e2d385a5d3
diff --git a/aos/events/logging/log_reader.h b/aos/events/logging/log_reader.h
index 3bdfca4..fb6d6f9 100644
--- a/aos/events/logging/log_reader.h
+++ b/aos/events/logging/log_reader.h
@@ -471,7 +471,7 @@
// OldestMessageTime.
void SeedSortedMessages();
- void SetupStartupTimer() {
+ void SetUpStartupTimer() {
const monotonic_clock::time_point start_time =
monotonic_start_time(boot_count());
if (start_time == monotonic_clock::min_time) {
@@ -483,7 +483,7 @@
if (node_event_loop_factory_) {
CHECK_GE(start_time + clock_offset(), event_loop_->monotonic_now());
}
- startup_timer_->Setup(start_time + clock_offset());
+ startup_timer_->Schedule(start_time + clock_offset());
}
void set_startup_timer(TimerHandler *timer_handler) {
@@ -653,8 +653,8 @@
void ClearTimeFlags();
// Sets the next wakeup time on the replay callback.
- void Setup(monotonic_clock::time_point next_time) {
- timer_handler_->Setup(
+ void Schedule(monotonic_clock::time_point next_time) {
+ timer_handler_->Schedule(
std::max(monotonic_now(), next_time + clock_offset()));
}