TypeDef.h revision 5a545440766886a1bbd09ed7221bb337705e5d14
1#ifndef TYPE_DEF_H_
2
3#define TYPE_DEF_H_
4
5#include "NamedType.h"
6
7namespace android {
8
9struct TypeDef : public NamedType {
10    TypeDef(Type *type);
11
12    const ScalarType *resolveToScalarType() const override;
13
14    const Type *referencedType() const;
15
16    bool isInterface() const override;
17
18    std::string getCppType(StorageMode mode, std::string *extra) const override;
19
20    void emitReaderWriter(
21            Formatter &out,
22            const std::string &name,
23            const std::string &parcelObj,
24            bool parcelObjIsPointer,
25            bool isReader,
26            ErrorMode mode) const override;
27
28    void emitReaderWriterEmbedded(
29            Formatter &out,
30            const std::string &name,
31            bool nameIsPointer,
32            const std::string &parcelObj,
33            bool parcelObjIsPointer,
34            bool isReader,
35            ErrorMode mode,
36            const std::string &parentName,
37            const std::string &offsetText) const override;
38
39private:
40    Type *mReferencedType;
41
42    DISALLOW_COPY_AND_ASSIGN(TypeDef);
43};
44
45}  // namespace android
46
47#endif  // TYPE_DEF_H_
48
49