Pull Element and FieldElement out into functions
This makes them easier to reuse in the future and a little less coupled.
Change-Id: Ib70319ed91381e0b30f4e87fbfe6d262c1c0f179
diff --git a/aos/flatbuffer_utils.h b/aos/flatbuffer_utils.h
new file mode 100644
index 0000000..2b1c1ab
--- /dev/null
+++ b/aos/flatbuffer_utils.h
@@ -0,0 +1,16 @@
+#ifndef AOS_FLATBUFFER_UTILS_
+#define AOS_FLATBUFFER_UTILS_
+
+#include "flatbuffers/flatbuffers.h"
+
+namespace aos {
+
+// Returns a human readable description of the type.
+inline const char *ElementaryTypeName(
+ const flatbuffers::ElementaryType elementary_type) {
+ return flatbuffers::ElementaryTypeNames()[elementary_type] + 3;
+}
+
+} // namespace aos
+
+#endif // AOS_FLATBUFFER_UTILS_