Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 1 | #ifndef INTERFACE_H_ |
| 2 | |
| 3 | #define INTERFACE_H_ |
| 4 | |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame] | 5 | #include "Method.h" |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 6 | #include "Scope.h" |
| 7 | |
Zhuoyao Zhang | ba7e6e9 | 2016-08-10 12:19:02 -0700 | [diff] [blame] | 8 | #include <utils/KeyedVector.h> |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 9 | #include <vector> |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 10 | |
| 11 | namespace android { |
| 12 | |
Zhuoyao Zhang | ba7e6e9 | 2016-08-10 12:19:02 -0700 | [diff] [blame] | 13 | struct Annotation; |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 14 | struct Method; |
| 15 | |
| 16 | struct Interface : public Scope { |
Zhuoyao Zhang | ba7e6e9 | 2016-08-10 12:19:02 -0700 | [diff] [blame] | 17 | Interface( |
| 18 | Interface *super, |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame] | 19 | AnnotationVector *annotations); |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 20 | |
| 21 | void addMethod(Method *method); |
| 22 | |
Andreas Huber | a2723d2 | 2016-07-29 15:36:07 -0700 | [diff] [blame] | 23 | bool isInterface() const override; |
Andreas Huber | 295ad30 | 2016-08-16 11:35:00 -0700 | [diff] [blame] | 24 | bool isBinder() const override; |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 25 | |
Andreas Huber | 6cb08cf | 2016-08-03 15:44:51 -0700 | [diff] [blame] | 26 | const Interface *superType() const; |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 27 | |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 28 | const std::vector<Method *> &methods() const; |
| 29 | |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame] | 30 | const AnnotationVector &annotations() const; |
Zhuoyao Zhang | ba7e6e9 | 2016-08-10 12:19:02 -0700 | [diff] [blame] | 31 | |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 32 | std::string getCppType(StorageMode mode, std::string *extra) const override; |
| 33 | |
Andreas Huber | 2831d51 | 2016-08-15 09:33:47 -0700 | [diff] [blame] | 34 | std::string getJavaType() const override; |
| 35 | |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 36 | void emitReaderWriter( |
| 37 | Formatter &out, |
| 38 | const std::string &name, |
| 39 | const std::string &parcelObj, |
| 40 | bool parcelObjIsPointer, |
| 41 | bool isReader, |
| 42 | ErrorMode mode) const override; |
| 43 | |
Andreas Huber | 2831d51 | 2016-08-15 09:33:47 -0700 | [diff] [blame] | 44 | void emitJavaReaderWriter( |
| 45 | Formatter &out, |
| 46 | const std::string &parcelObj, |
| 47 | const std::string &argName, |
| 48 | bool isReader) const override; |
| 49 | |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame] | 50 | status_t emitVtsArgumentType(Formatter &out) const override; |
| 51 | |
Andreas Huber | 70a59e1 | 2016-08-16 12:57:01 -0700 | [diff] [blame] | 52 | bool isJavaCompatible() const override; |
| 53 | |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 54 | private: |
Andreas Huber | 6cb08cf | 2016-08-03 15:44:51 -0700 | [diff] [blame] | 55 | Interface *mSuperType; |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 56 | std::vector<Method *> mMethods; |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame] | 57 | AnnotationVector *mAnnotationsByName; |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 58 | |
| 59 | DISALLOW_COPY_AND_ASSIGN(Interface); |
| 60 | }; |
| 61 | |
| 62 | } // namespace android |
| 63 | |
| 64 | #endif // INTERFACE_H_ |
| 65 | |