Rename Location to Channel and add extra Flatbuffer helpers
This now follows the convention in the design doc and is more closely
aligned to classic pubsub terminology.
Also add a Flatbuffer<T> base type, along with both an array backed
version. Rename the DetachedBuffer variant.
Change-Id: I257b5dbb5838120c479c4b98139657fc08e73150
diff --git a/aos/flatbuffers.cc b/aos/flatbuffers.cc
new file mode 100644
index 0000000..3fe22c0
--- /dev/null
+++ b/aos/flatbuffers.cc
@@ -0,0 +1,22 @@
+#include "aos/flatbuffers.h"
+
+#include "glog/logging.h"
+
+namespace aos {
+
+uint8_t *FixedAllocatorBase::allocate(size_t) {
+ if (is_allocated_) {
+ LOG(FATAL) << "Tried to allocate already allocated flatbuffer";
+ }
+
+ is_allocated_ = true;
+ return data();
+}
+
+uint8_t *FixedAllocatorBase::reallocate_downward(uint8_t *, size_t, size_t,
+ size_t, size_t) {
+ LOG(FATAL) << "Tried to reallocate a flatbuffer";
+ return nullptr;
+}
+
+} // namespace aos