blob: 5ccbf01211d5e6371608bab7b3b6cbdfe25995b6 [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 Huberc9410c72016-07-28 12:18:40 -070017#ifndef TYPE_DEF_H_
18
19#define TYPE_DEF_H_
20
Steven Morelandd537ab02016-09-12 10:32:01 -070021#include "NamedType.h"
Andreas Huberc9410c72016-07-28 12:18:40 -070022
23namespace android {
24
Steven Morelandd537ab02016-09-12 10:32:01 -070025struct TypeDef : public NamedType {
Yifan Honga4b53d02016-10-31 17:29:10 -070026 TypeDef(const char* localName, const Location &location, Type *type);
Andreas Huberc9410c72016-07-28 12:18:40 -070027
Andreas Huber737080b2016-08-02 15:38:04 -070028 const ScalarType *resolveToScalarType() const override;
29
Andreas Huber8d3ac0c2016-08-04 14:49:23 -070030 Type *referencedType() const;
Andreas Huberc9410c72016-07-28 12:18:40 -070031
Andreas Huber5a545442016-08-03 10:44:56 -070032 bool isInterface() const override;
Andreas Huber8d3ac0c2016-08-04 14:49:23 -070033 bool isEnum() const override;
34 bool isTypeDef() const override;
Andreas Huberbb797e42016-08-03 12:53:02 -070035 bool needsEmbeddedReadWrite() const override;
36 bool resultNeedsDeref() const override;
37
Steven Moreland2a55e052016-09-27 10:14:24 -070038 status_t emitTypeDeclarations(Formatter &out) const override;
39
Andreas Huberc9410c72016-07-28 12:18:40 -070040private:
41 Type *mReferencedType;
42
43 DISALLOW_COPY_AND_ASSIGN(TypeDef);
44};
45
46} // namespace android
47
48#endif // TYPE_DEF_H_
49