Arrays in .hal files are now exposed to C++ as hidl_array<T, SIZE ...>
instead of as native arrays. This allows them to be copied which in turn lets
them exist in vectors. In the Java backend, vectors are limited to
one-dimensional arrays and scalar arrays are properly wrapped,
i.e. vec<uint8_t[]> => Vector<Byte[]>
Change-Id: I47524ec8423dfb41a436df36af8fa05eb8b3c0cc
Bug: 31682327
Test: hidl_test and hidl_test_java
diff --git a/ArrayType.h b/ArrayType.h
index c0adbde..440a66c 100644
--- a/ArrayType.h
+++ b/ArrayType.h
@@ -36,7 +36,10 @@
bool isArray() const override;
+ Type *getElementType() const;
+
void addDimension(ConstantExpression *size);
+ size_t countDimensions() const;
std::string getCppType(StorageMode mode,
std::string *extra,
@@ -47,6 +50,8 @@
std::string getJavaType(
std::string *extra, bool forInitializer) const override;
+ std::string getJavaWrapperType() const override;
+
void emitReaderWriter(
Formatter &out,
const std::string &name,
@@ -68,6 +73,7 @@
const std::string &offsetText) const override;
bool needsEmbeddedReadWrite() const override;
+ bool resultNeedsDeref() const override;
void emitJavaReaderWriter(
Formatter &out,