dynamically generate host-side data object generator from the spec

Change-Id: I0eac7ec273c0e30ada47ce171e1bb9a5b58e9be3
diff --git a/sysfuzzer/vtscompiler/code_gen/HalCodeGen.cpp b/sysfuzzer/vtscompiler/code_gen/HalCodeGen.cpp
index 955fc55..d351304 100644
--- a/sysfuzzer/vtscompiler/code_gen/HalCodeGen.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/HalCodeGen.cpp
@@ -53,8 +53,8 @@
       cpp_ss << "    " << GetCppVariableType(arg) << " ";
       cpp_ss << "arg" << arg_count << " = ";
       if (arg_count == 0
-          && arg.has_aggregate_type()
-          && !strncmp(arg.aggregate_type().c_str(),
+          && arg.aggregate_type().size() == 1
+          && !strncmp(arg.aggregate_type(0).c_str(),
                       message.original_data_structure_name().c_str(),
                       message.original_data_structure_name().length())) {
         cpp_ss << "reinterpret_cast<" << GetCppVariableType(arg) << ">("
@@ -78,8 +78,8 @@
     // actual function call
     GenerateCodeToStartMeasurement(cpp_ss);
     cpp_ss << "    ";
-    if (api.return_type().has_primitive_type()
-        && !strcmp(api.return_type().primitive_type().c_str(), "void")) {
+    if (api.return_type().primitive_type().size() == 1
+        && !strcmp(api.return_type().primitive_type(0).c_str(), "void")) {
       cpp_ss << "*result = NULL;" << endl;
     } else {
       cpp_ss << "*result = const_cast<void*>(reinterpret_cast<const void*>(";
@@ -94,8 +94,9 @@
         cpp_ss << "," << endl;
       }
     }
-    if (!api.return_type().has_primitive_type()
-        || strcmp(api.return_type().primitive_type().c_str(), "void")) {
+    if (api.return_type().primitive_type().size() == 0
+        || (api.return_type().primitive_type().size() == 1
+            && strcmp(api.return_type().primitive_type(0).c_str(), "void"))) {
       cpp_ss << "))";
     }
     cpp_ss << ");" << endl;