Use TypeNamespace instances in aidl.cpp
Refactor much of the logic around types into an instance of
TypeNamespace. This class defines an interface to type reasoning
logic that aidl.cpp can use to register binder and parcelable types
it loads during parsing. Code generation can use a language specific
subclass of the type namespace to reason about types more specifically.
For now, leave NAMES and the global type constants intact. We'll
refactor those in a separate change if necessary.
Bug: 24303749
Test: Compiles, unittests pass
Change-Id: Ie56a89159c956c587a1ff3e45d38d1850b04a9f2
diff --git a/generate_java.cpp b/generate_java.cpp
index 09a4410..116b5c4 100644
--- a/generate_java.cpp
+++ b/generate_java.cpp
@@ -64,12 +64,12 @@
// =================================================
int
generate_java(const string& filename, const string& originalSrc,
- interface_type* iface)
+ interface_type* iface, JavaTypeNamespace* types)
{
Class* cl;
if (iface->document_item.item_type == INTERFACE_TYPE_BINDER) {
- cl = generate_binder_interface_class(iface);
+ cl = generate_binder_interface_class(iface, types);
}
Document* document = new Document;