Add c++-headers and c++-sources

This way, hidl-gen won't generate headers+sources multiple times.

Test: hidl implementations still link
Test: updated various interface roots
Bug: 38174080
Merged-In: Ibc036df4bda7e4f41eb92865fe3e47376a6a3fbd
Change-Id: Ibc036df4bda7e4f41eb92865fe3e47376a6a3fbd
diff --git a/generateCpp.cpp b/generateCpp.cpp
index 8dcb56e..6d67a3d 100644
--- a/generateCpp.cpp
+++ b/generateCpp.cpp
@@ -34,6 +34,16 @@
 namespace android {
 
 status_t AST::generateCpp(const std::string &outputPath) const {
+    status_t err = generateCppHeaders(outputPath);
+
+    if (err == OK) {
+        err = generateCppSources(outputPath);
+    }
+
+    return err;
+}
+
+status_t AST::generateCppHeaders(const std::string &outputPath) const {
     status_t err = generateInterfaceHeader(outputPath);
 
     if (err == OK) {
@@ -49,10 +59,6 @@
     }
 
     if (err == OK) {
-        err = generateAllSource(outputPath);
-    }
-
-    if (err == OK) {
         err = generatePassthroughHeader(outputPath);
     }
 
@@ -997,7 +1003,7 @@
     return OK;
 }
 
-status_t AST::generateAllSource(const std::string &outputPath) const {
+status_t AST::generateCppSources(const std::string &outputPath) const {
 
     std::string path = outputPath;
     path.append(mCoordinator->convertPackageRootToPath(mPackage));