move read/writeEmbedded[References]From/ToParcel out

from hidl_string, hidl_vec, and structs.

* Add a hwtypes.h in the autogenerated files, which
  contains the read/writeEmbeddedFrom/ToParcel
  methods for structs defined in types.h.

* Fixes the hack that remove the warnings when compiling
  the generated code (useParentInEmitResolveReferencesEmbedded())
  and add one more hack (useNameInEmitReaderWriterEmbedded())

* Some clean-up on Scope.cpp (add a forEachType function)

Test: mma
Test: hidl_test

Bug: 32756130

Change-Id: Icfd116b5d92fef78d257337c3f2ef02071f7600b
diff --git a/PredefinedType.h b/PredefinedType.h
index cbfbcf9..a3f2e81 100644
--- a/PredefinedType.h
+++ b/PredefinedType.h
@@ -23,10 +23,12 @@
 namespace android {
 
 struct PredefinedType : public Type {
-    PredefinedType(const char *name);
+    PredefinedType(const char *nsp, const char *name);
 
     void addNamedTypesToSet(std::set<const FQName> &set) const override;
 
+    std::string fullName() const;
+
     std::string getCppType(
             StorageMode mode,
             bool specifyNamespaces) const override;
@@ -58,6 +60,7 @@
     bool resultNeedsDeref() const override;
 
 private:
+    std::string mNamespace;
     std::string mName;
 
     DISALLOW_COPY_AND_ASSIGN(PredefinedType);