summaryrefslogtreecommitdiffstats
path: root/type_namespace.h
diff options
context:
space:
mode:
authorChristopher Wiley <wiley@google.com>2016-01-25 14:51:17 -0800
committerChristopher Wiley <wiley@google.com>2016-01-26 13:37:15 -0800
commite22b41a8ecf20704050ef6dd4abdd0a39adb2320 (patch)
tree99a28020794d1fee53a93857731d0064dd0b57d2 /type_namespace.h
parentec31a050fd861c5d17f3cb092492243945e865fd (diff)
downloadandroid_system_tools_aidl-e22b41a8ecf20704050ef6dd4abdd0a39adb2320.tar.gz
android_system_tools_aidl-e22b41a8ecf20704050ef6dd4abdd0a39adb2320.tar.bz2
android_system_tools_aidl-e22b41a8ecf20704050ef6dd4abdd0a39adb2320.zip
Consolidate logic to retreive language specific type
In preparation for adding some special casing to the "String" AIDL type, consolidate the logic to pick a language specific type from the aidl type into a single helper function GetTypeImpl(). Rename GetValidatableType to GetTypeByName to avoid confusion and better describe the semantics of that method. Bug: 26729450 Test: unittests continue to pass Change-Id: Ie9391ea90a31da77657353a87031492849b58409
Diffstat (limited to 'type_namespace.h')
-rw-r--r--type_namespace.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/type_namespace.h b/type_namespace.h
index e073c21..52a3f5c 100644
--- a/type_namespace.h
+++ b/type_namespace.h
@@ -114,7 +114,7 @@ class TypeNamespace {
std::vector<std::string>* contained_type_names) const;
// Get a pointer to an existing type.
- virtual const ValidatableType* GetValidatableType(
+ virtual const ValidatableType* FindTypeByName(
const std::string& name) const = 0;
protected:
@@ -122,6 +122,9 @@ class TypeNamespace {
virtual ~TypeNamespace() = default;
private:
+ const ValidatableType* GetType(const AidlType& type,
+ std::string* error_msg) const;
+
DISALLOW_COPY_AND_ASSIGN(TypeNamespace);
};
@@ -135,7 +138,7 @@ class LanguageTypeNamespace : public TypeNamespace {
// name, and then class name (dropping package qualifiers).
const T* Find(const std::string& name) const;
- const ValidatableType* GetValidatableType(
+ const ValidatableType* FindTypeByName(
const std::string& name) const override { return Find(name); }
protected: