blob: 7ad0d6d23ee66f965b4aff5ce5e02534471fa5b5 [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 {
Andreas Huber6cb08cf2016-08-03 15:44:51 -070014 Interface(Interface *super);
Andreas Huberc9410c72016-07-28 12:18:40 -070015
16 void addMethod(Method *method);
17
Andreas Hubera2723d22016-07-29 15:36:07 -070018 bool isInterface() const override;
Andreas Huberc9410c72016-07-28 12:18:40 -070019
Andreas Huber6cb08cf2016-08-03 15:44:51 -070020 const Interface *superType() const;
Andreas Huberc9410c72016-07-28 12:18:40 -070021
Andreas Huber881227d2016-08-02 14:20:21 -070022 const std::vector<Method *> &methods() const;
23
24 std::string getCppType(StorageMode mode, std::string *extra) const override;
25
26 void emitReaderWriter(
27 Formatter &out,
28 const std::string &name,
29 const std::string &parcelObj,
30 bool parcelObjIsPointer,
31 bool isReader,
32 ErrorMode mode) const override;
33
Andreas Huberc9410c72016-07-28 12:18:40 -070034private:
Andreas Huber6cb08cf2016-08-03 15:44:51 -070035 Interface *mSuperType;
Andreas Huber881227d2016-08-02 14:20:21 -070036 std::vector<Method *> mMethods;
Andreas Huberc9410c72016-07-28 12:18:40 -070037
38 DISALLOW_COPY_AND_ASSIGN(Interface);
39};
40
41} // namespace android
42
43#endif // INTERFACE_H_
44