Move annotations from Type to Scope
Test: hidl_test
Change-Id: I0b570096c38e27cb818930bd508d31aa47fe5d4d
diff --git a/Scope.cpp b/Scope.cpp
index 1cee4f8..9223b78 100644
--- a/Scope.cpp
+++ b/Scope.cpp
@@ -16,6 +16,7 @@
#include "Scope.h"
+#include "Annotation.h"
#include "Interface.h"
#include <android-base/logging.h>
@@ -103,6 +104,16 @@
return false;
}
+const std::vector<Annotation*>& Scope::annotations() const {
+ return mAnnotations;
+}
+
+void Scope::setAnnotations(std::vector<Annotation*>* annotations) {
+ CHECK(mAnnotations.empty());
+ CHECK(annotations != nullptr);
+ mAnnotations = *annotations;
+}
+
status_t Scope::forEachType(std::function<status_t(Type *)> func) const {
for (size_t i = 0; i < mTypes.size(); ++i) {
status_t err = func(mTypes[i]);