blob: f1aaf5287b0a1f2d3b2093da82c4ad74c98ea53d [file] [log] [blame]
Andreas Huber1aec3972016-08-26 09:26:32 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Andreas Huber3599d922016-08-09 10:42:57 -070017#ifndef ANNOTATION_H_
18
19#define ANNOTATION_H_
20
21#include <android-base/macros.h>
22
23#include <string>
24#include <utils/KeyedVector.h>
25
26namespace android {
27
28struct Formatter;
Zhuoyao Zhang5158db42016-08-10 10:25:20 -070029using AnnotationParamVector =
30 DefaultKeyedVector<std::string, std::vector<std::string> *>;
Andreas Huber3599d922016-08-09 10:42:57 -070031
32struct Annotation {
Zhuoyao Zhang5158db42016-08-10 10:25:20 -070033 Annotation(const char *name, AnnotationParamVector *params);
Andreas Huber3599d922016-08-09 10:42:57 -070034
35 std::string name() const;
Zhuoyao Zhang5158db42016-08-10 10:25:20 -070036 const AnnotationParamVector &params() const;
Andreas Huber3599d922016-08-09 10:42:57 -070037
38 void dump(Formatter &out) const;
39
40private:
41 std::string mName;
Zhuoyao Zhang5158db42016-08-10 10:25:20 -070042 AnnotationParamVector *mParamsByName;
Andreas Huber3599d922016-08-09 10:42:57 -070043
44 DISALLOW_COPY_AND_ASSIGN(Annotation);
45};
46
47} // namespace android
48
49#endif // ANNOTATION_H_