Merge "Add CopyFlatBuffer helper to the Fetcher"
diff --git a/aos/events/event_loop.h b/aos/events/event_loop.h
index 74f26e4..a1f87cd 100644
--- a/aos/events/event_loop.h
+++ b/aos/events/event_loop.h
@@ -74,7 +74,7 @@
// the caller has access to this context, which makes this pretty useless.
int buffer_index;
- // Efficiently coppies the flatbuffer into a FlatbufferVector, allocating
+ // Efficiently copies the flatbuffer into a FlatbufferVector, allocating
// memory in the process. It is vital that T matches the type of the
// underlying flatbuffer.
template <typename T>
@@ -269,6 +269,11 @@
// Returns true if this fetcher is valid and connected to a channel.
operator bool() const { return static_cast<bool>(fetcher_); }
+ // Copies the current flatbuffer into a FlatbufferVector.
+ FlatbufferVector<T> CopyFlatBuffer() const {
+ return context().template CopyFlatBuffer<T>();
+ }
+
private:
friend class EventLoop;
Fetcher(::std::unique_ptr<RawFetcher> fetcher)