Scope.h revision c9410c7e62a33fd7599b2f3e025093a2d171577e
1#ifndef SCOPE_H_
2
3#define SCOPE_H_
4
5#include "NamedType.h"
6
7#include <utils/KeyedVector.h>
8#include <utils/Vector.h>
9
10namespace android {
11
12struct Constant;
13
14struct Scope : public NamedType {
15    Scope(const char *name);
16
17    bool addType(NamedType *type);
18    Type *lookupType(const char *name) const;
19
20    bool addConstant(Constant *constant);
21
22    void dump(Formatter &out) const override;
23
24private:
25    Vector<Type *> mTypes;
26    KeyedVector<std::string, size_t> mTypeIndexByName;
27
28    KeyedVector<std::string, Constant *> mConstants;
29
30    DISALLOW_COPY_AND_ASSIGN(Scope);
31};
32
33}  // namespace android
34
35#endif  // SCOPE_H_
36
37