1f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland/*
2f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * Copyright (C) 2016 The Android Open Source Project
3f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland *
4f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * Licensed under the Apache License, Version 2.0 (the "License");
5f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * you may not use this file except in compliance with the License.
6f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * You may obtain a copy of the License at
7f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland *
8f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland *      http://www.apache.org/licenses/LICENSE-2.0
9f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland *
10f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * Unless required by applicable law or agreed to in writing, software
11f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * distributed under the License is distributed on an "AS IS" BASIS,
12f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * See the License for the specific language governing permissions and
14f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * limitations under the License.
15f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland */
16f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland
17f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#ifndef NOTE_DECLARATION_H_
18f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#define NOTE_DECLARATION_H_
19f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland
20f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#include <android-base/macros.h>
21f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#include <android-base/logging.h>
22f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#include <string>
23f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#include <vector>
24f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland#include "Declaration.h"
25f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland
26f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Morelandnamespace android {
27f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland
28f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland/* This class is used to represent declarations or notes
29f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland * which are otherwise not included in a HIDL HAL
30f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland */
31f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Morelandstruct Note : Declaration {
32f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland    Note(const std::string &name);
333449bba54cc43e23c6e0e2a687ad686d82ad37f3Yifan Hong    // assume ownership on decl
343449bba54cc43e23c6e0e2a687ad686d82ad37f3Yifan Hong    Note(Declaration *decl);
35f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland    ~Note();
36f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland
37f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland    static std::string type() { return "note"; }
38f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland    const std::string decType() const override { return type(); }
39f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland
40f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland    void generateSource(Formatter &out) const override;
41f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland    void processContents(AST &ast) override;
42f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland
43f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Morelandprivate:
443449bba54cc43e23c6e0e2a687ad686d82ad37f3Yifan Hong    Declaration *mDecl = nullptr;
45f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland
46f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland    DISALLOW_COPY_AND_ASSIGN(Note);
47f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland};
48f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland
49f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland}  // namespace android
50f1a35f7d73f38e0d30d7a4343e33c3f4777cf87eSteven Moreland
512009699f1106709cf4bfb281e78efb4f3d04f1c6Yifan Hong#endif  // NOTE_DECLARATION_H_
52