summaryrefslogtreecommitdiffstats
path: root/type_namespace.h
diff options
context:
space:
mode:
authorCasey Dahlin <sadmac@google.com>2015-12-04 11:44:02 -0800
committerCasey Dahlin <sadmac@google.com>2015-12-15 13:01:23 -0800
commit57dbe24bcb8f4509a876e8445c78d9504d7e616a (patch)
treee61e854a15ff632f2ff75d152ffa2e3eabbf5b5a /type_namespace.h
parent7621d4d0592fbf3fb396d0c092a8e41c3c8215cd (diff)
downloadandroid_system_tools_aidl-57dbe24bcb8f4509a876e8445c78d9504d7e616a.tar.gz
android_system_tools_aidl-57dbe24bcb8f4509a876e8445c78d9504d7e616a.tar.bz2
android_system_tools_aidl-57dbe24bcb8f4509a876e8445c78d9504d7e616a.zip
Add support for @nullable annotation
Using this annotation will now cause C++ types to be wrapped in unique_ptr, and by extension be capable of handling null values. Support extends to all arrays, Strings, Lists, and Parcelables. Change-Id: I148a3666279c2badcba097b8925e55f8fcecb9c2 Test: Unit tests pass Bug: 25969194 Signed-off-by: Casey Dahlin <sadmac@google.com>
Diffstat (limited to 'type_namespace.h')
-rw-r--r--type_namespace.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/type_namespace.h b/type_namespace.h
index 453a1c2..e073c21 100644
--- a/type_namespace.h
+++ b/type_namespace.h
@@ -47,6 +47,7 @@ class ValidatableType {
virtual bool CanWriteToParcel() const = 0;
virtual const ValidatableType* ArrayType() const = 0;
+ virtual const ValidatableType* NullableType() const = 0;
// Name() returns the short name of an object (without package qualifiers).
virtual std::string Name() const { return type_name_; }
@@ -95,13 +96,13 @@ class TypeNamespace {
virtual bool IsValidPackage(const std::string& package) const;
// Returns true iff |raw_type| is a valid return type.
- virtual bool IsValidReturnType(const AidlType& raw_type,
- const std::string& filename) const;
+ virtual const ValidatableType* GetReturnType(const AidlType& raw_type,
+ const std::string& filename) const;
// Returns true iff |arg_type| is a valid method argument.
- virtual bool IsValidArg(const AidlArgument& a,
- int arg_index,
- const std::string& filename) const;
+ virtual const ValidatableType* GetArgType(const AidlArgument& a,
+ int arg_index,
+ const std::string& filename) const;
// Returns true if this is a container type, rather than a normal type.
virtual bool IsContainerType(const std::string& type_name) const;