aboutsummaryrefslogtreecommitdiffstats
path: root/Reference.h
diff options
context:
space:
mode:
authorTimur Iskhakov <iskhakovt@google.com>2017-08-31 16:33:41 -0700
committerTimur Iskhakov <iskhakovt@google.com>2017-09-05 15:14:22 -0700
commitdbaed3317411232962d25666de60799b4dcfce98 (patch)
treef087b152c8eb7fa13d4e504a55e6690a4a9bcadc /Reference.h
parent90e25cebb5203df7f50a7a3f9203a7bcc0ee1f3e (diff)
downloadandroid_system_tools_hidl-dbaed3317411232962d25666de60799b4dcfce98.tar.gz
android_system_tools_hidl-dbaed3317411232962d25666de60799b4dcfce98.tar.bz2
android_system_tools_hidl-dbaed3317411232962d25666de60799b4dcfce98.zip
Do not unwrap typedefs on lookups
TypeDefs were replaced with actual types in lookups, so package containing typedef could be not included. This change keeps typedef declarations and imports package with typedef declaration. Bug: 65266511 Test: mma Test: manual check that include became correct Test: /hardware/interfaces output is unchanged, however CL changes the behavior Change-Id: Iee78228c9acfa4dbd16c3ca4ec0d9568a927d0f6
Diffstat (limited to 'Reference.h')
-rw-r--r--Reference.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/Reference.h b/Reference.h
index 13f209a..a016ef6 100644
--- a/Reference.h
+++ b/Reference.h
@@ -51,12 +51,25 @@ struct Reference {
T* operator->() { return get(); }
const T* operator->() const { return get(); }
+ /* Returns referenced object.
+ If a type is referenced, all typedefs are unwraped. */
T* get() {
CHECK(mResolved != nullptr);
- return mResolved;
+ return mResolved->resolve();
}
const T* get() const {
CHECK(mResolved != nullptr);
+ return mResolved->resolve();
+ }
+
+ /* Returns exact referenced object.
+ If a type is referenced, typedefs are not unwraped. */
+ T* shallowGet() {
+ CHECK(mResolved != nullptr);
+ return mResolved;
+ }
+ const T* shallowGet() const {
+ CHECK(mResolved != nullptr);
return mResolved;
}