Andreas Huber | 3599d92 | 2016-08-09 10:42:57 -0700 | [diff] [blame] | 1 | #ifndef ANNOTATION_H_ |
| 2 | |
| 3 | #define ANNOTATION_H_ |
| 4 | |
| 5 | #include <android-base/macros.h> |
| 6 | |
| 7 | #include <string> |
| 8 | #include <utils/KeyedVector.h> |
| 9 | |
| 10 | namespace android { |
| 11 | |
| 12 | struct Formatter; |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame^] | 13 | using AnnotationParamVector = |
| 14 | DefaultKeyedVector<std::string, std::vector<std::string> *>; |
Andreas Huber | 3599d92 | 2016-08-09 10:42:57 -0700 | [diff] [blame] | 15 | |
| 16 | struct Annotation { |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame^] | 17 | Annotation(const char *name, AnnotationParamVector *params); |
Andreas Huber | 3599d92 | 2016-08-09 10:42:57 -0700 | [diff] [blame] | 18 | |
| 19 | std::string name() const; |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame^] | 20 | const AnnotationParamVector ¶ms() const; |
Andreas Huber | 3599d92 | 2016-08-09 10:42:57 -0700 | [diff] [blame] | 21 | |
| 22 | void dump(Formatter &out) const; |
| 23 | |
| 24 | private: |
| 25 | std::string mName; |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame^] | 26 | AnnotationParamVector *mParamsByName; |
Andreas Huber | 3599d92 | 2016-08-09 10:42:57 -0700 | [diff] [blame] | 27 | |
| 28 | DISALLOW_COPY_AND_ASSIGN(Annotation); |
| 29 | }; |
| 30 | |
| 31 | } // namespace android |
| 32 | |
| 33 | #endif // ANNOTATION_H_ |