blob: 07c6d83861ea0c529dbdfd9d6703ea110fad8a6b [file] [log] [blame]
Andreas Huber3599d922016-08-09 10:42:57 -07001#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
10namespace android {
11
12struct Formatter;
Zhuoyao Zhang5158db42016-08-10 10:25:20 -070013using AnnotationParamVector =
14 DefaultKeyedVector<std::string, std::vector<std::string> *>;
Andreas Huber3599d922016-08-09 10:42:57 -070015
16struct Annotation {
Zhuoyao Zhang5158db42016-08-10 10:25:20 -070017 Annotation(const char *name, AnnotationParamVector *params);
Andreas Huber3599d922016-08-09 10:42:57 -070018
19 std::string name() const;
Zhuoyao Zhang5158db42016-08-10 10:25:20 -070020 const AnnotationParamVector &params() const;
Andreas Huber3599d922016-08-09 10:42:57 -070021
22 void dump(Formatter &out) const;
23
24private:
25 std::string mName;
Zhuoyao Zhang5158db42016-08-10 10:25:20 -070026 AnnotationParamVector *mParamsByName;
Andreas Huber3599d922016-08-09 10:42:57 -070027
28 DISALLOW_COPY_AND_ASSIGN(Annotation);
29};
30
31} // namespace android
32
33#endif // ANNOTATION_H_