blob: 04a272c107312eab7b0da553e399dd9cebaa954c [file] [log] [blame]
Andreas Huberc9410c72016-07-28 12:18:40 -07001#ifndef INTERFACE_H_
2
3#define INTERFACE_H_
4
5#include "Scope.h"
6
Andreas Huber881227d2016-08-02 14:20:21 -07007#include <vector>
Andreas Huberc9410c72016-07-28 12:18:40 -07008
9namespace android {
10
11struct Method;
12
13struct Interface : public Scope {
14 Interface(const char *name, Type *super);
15
16 void addMethod(Method *method);
17
18 void dump(Formatter &out) const override;
Andreas Hubera2723d22016-07-29 15:36:07 -070019 bool isInterface() const override;
Andreas Huberc9410c72016-07-28 12:18:40 -070020
21 const Type *superType() const;
22
Andreas Huber881227d2016-08-02 14:20:21 -070023 const std::vector<Method *> &methods() const;
24
25 std::string getCppType(StorageMode mode, std::string *extra) const override;
26
27 void emitReaderWriter(
28 Formatter &out,
29 const std::string &name,
30 const std::string &parcelObj,
31 bool parcelObjIsPointer,
32 bool isReader,
33 ErrorMode mode) const override;
34
Andreas Huberc9410c72016-07-28 12:18:40 -070035private:
Andreas Huberc9410c72016-07-28 12:18:40 -070036 Type *mSuperType;
Andreas Huber881227d2016-08-02 14:20:21 -070037 std::vector<Method *> mMethods;
Andreas Huberc9410c72016-07-28 12:18:40 -070038
39 DISALLOW_COPY_AND_ASSIGN(Interface);
40};
41
42} // namespace android
43
44#endif // INTERFACE_H_
45