Method.h revision 867fcb63af8c3ac96ed1b3f3950525aa70393bdf
1#ifndef METHOD_H_
2
3#define METHOD_H_
4
5#include <android-base/macros.h>
6#include <string>
7#include <vector>
8
9namespace android {
10
11struct Formatter;
12struct Type;
13
14struct TypedVar {
15    TypedVar(const char *name, Type *type);
16
17    std::string name() const;
18    const Type &type() const;
19
20private:
21    std::string mName;
22    Type *mType;
23
24    DISALLOW_COPY_AND_ASSIGN(TypedVar);
25};
26
27struct Method {
28    Method(const char *name,
29           std::vector<TypedVar *> *args,
30           std::vector<TypedVar *> *results = NULL);
31
32    std::string name() const;
33    const std::vector<TypedVar *> &args() const;
34    const std::vector<TypedVar *> &results() const;
35
36    static std::string GetSignature(const std::vector<TypedVar *> &args);
37
38private:
39    std::string mName;
40    std::vector<TypedVar *> *mArgs;
41    std::vector<TypedVar *> *mResults;
42
43    DISALLOW_COPY_AND_ASSIGN(Method);
44};
45
46}  // namespace android
47
48#endif  // METHOD_H_
49
50