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