Allow struct, union and enum type declarations to be annotated.
Change-Id: Idce594b47c324d8420638e2e8853da3c99150672
Bug: 31800672
Test: hidl_test, hidl_test_java
diff --git a/Type.cpp b/Type.cpp
index e42f072..e54fdc5 100644
--- a/Type.cpp
+++ b/Type.cpp
@@ -16,6 +16,7 @@
#include "Type.h"
+#include "Annotation.h"
#include "ScalarType.h"
#include <hidl-util/Formatter.h>
@@ -23,9 +24,20 @@
namespace android {
-Type::Type() {}
+Type::Type()
+ : mAnnotations(nullptr) {
+}
+
Type::~Type() {}
+void Type::setAnnotations(std::vector<Annotation *> *annotations) {
+ mAnnotations = annotations;
+}
+
+const std::vector<Annotation *> &Type::annotations() const {
+ return *mAnnotations;
+}
+
bool Type::isScope() const {
return false;
}