Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 1 | #include "TypeDef.h" |
| 2 | |
| 3 | #include "Formatter.h" |
| 4 | |
| 5 | namespace android { |
| 6 | |
| 7 | TypeDef::TypeDef(const char *name, Type *type) |
| 8 | : NamedType(name), |
| 9 | mReferencedType(type) { |
| 10 | } |
| 11 | |
Andreas Huber | 737080b | 2016-08-02 15:38:04 -0700 | [diff] [blame] | 12 | const ScalarType *TypeDef::resolveToScalarType() const { |
| 13 | return mReferencedType->resolveToScalarType(); |
| 14 | } |
| 15 | |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 16 | const Type *TypeDef::referencedType() const { |
| 17 | return mReferencedType; |
| 18 | } |
| 19 | |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 20 | std::string TypeDef::getCppType(StorageMode mode, std::string *extra) const { |
| 21 | return mReferencedType->getCppType(mode, extra); |
| 22 | } |
| 23 | |
| 24 | void TypeDef::emitReaderWriter( |
| 25 | Formatter &out, |
| 26 | const std::string &name, |
| 27 | const std::string &parcelObj, |
| 28 | bool parcelObjIsPointer, |
| 29 | bool isReader, |
| 30 | ErrorMode mode) const { |
| 31 | mReferencedType->emitReaderWriter( |
| 32 | out, name, parcelObj, parcelObjIsPointer, isReader, mode); |
| 33 | } |
| 34 | |
| 35 | void TypeDef::emitReaderWriterEmbedded( |
| 36 | Formatter &out, |
| 37 | const std::string &name, |
| 38 | bool nameIsPointer, |
| 39 | const std::string &parcelObj, |
| 40 | bool parcelObjIsPointer, |
| 41 | bool isReader, |
| 42 | ErrorMode mode, |
| 43 | const std::string &parentName, |
| 44 | const std::string &offsetText) const { |
| 45 | mReferencedType->emitReaderWriterEmbedded( |
| 46 | out, |
| 47 | name, |
| 48 | nameIsPointer, |
| 49 | parcelObj, |
| 50 | parcelObjIsPointer, |
| 51 | isReader, |
| 52 | mode, |
| 53 | parentName, |
| 54 | offsetText); |
| 55 | } |
| 56 | |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 57 | } // namespace android |
| 58 | |