Use overloading instead of default values
As we are getting ready to add the send boot UUID everywhere, that will
require a UUID as an argument to all the Send methods with a default
that is event_loop_->boot_uuid(). That doesn't work. Instead, use
overloading to achieve the same purpose.
There are few call sites for all of these, so it isn't hard to change
them all.
Change-Id: Id1e17bbef2e63c72fa6ad2b038c69d452610e86e
diff --git a/aos/events/event_loop.h b/aos/events/event_loop.h
index b8f8d2d..22f7c6f 100644
--- a/aos/events/event_loop.h
+++ b/aos/events/event_loop.h
@@ -147,21 +147,18 @@
// get the sent times instead.
virtual void *data() = 0;
virtual size_t size() = 0;
- bool Send(size_t size,
- aos::monotonic_clock::time_point monotonic_remote_time =
- aos::monotonic_clock::min_time,
- aos::realtime_clock::time_point realtime_remote_time =
- aos::realtime_clock::min_time,
- uint32_t remote_queue_index = 0xffffffffu);
+ bool Send(size_t size);
+ bool Send(size_t size, monotonic_clock::time_point monotonic_remote_time,
+ realtime_clock::time_point realtime_remote_time,
+ uint32_t remote_queue_index);
// Sends a single block of data by copying it.
// The remote arguments have the same meaning as in Send above.
+ bool Send(const void *data, size_t size);
bool Send(const void *data, size_t size,
- aos::monotonic_clock::time_point monotonic_remote_time =
- aos::monotonic_clock::min_time,
- aos::realtime_clock::time_point realtime_remote_time =
- aos::realtime_clock::min_time,
- uint32_t remote_queue_index = 0xffffffffu);
+ monotonic_clock::time_point monotonic_remote_time,
+ realtime_clock::time_point realtime_remote_time,
+ uint32_t remote_queue_index);
const Channel *channel() const { return channel_; }
@@ -190,10 +187,8 @@
protected:
EventLoop *event_loop() { return event_loop_; }
- aos::monotonic_clock::time_point monotonic_sent_time_ =
- aos::monotonic_clock::min_time;
- aos::realtime_clock::time_point realtime_sent_time_ =
- aos::realtime_clock::min_time;
+ monotonic_clock::time_point monotonic_sent_time_ = monotonic_clock::min_time;
+ realtime_clock::time_point realtime_sent_time_ = realtime_clock::min_time;
uint32_t sent_queue_index_ = 0xffffffff;
private: