blob: b5c65d6ea610565fcf543c69388994763e5878a3 [file] [log] [blame]
Andreas Huberc9410c72016-07-28 12:18:40 -07001#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;
Andreas Huber5345ec22016-07-29 13:33:27 -070023 bool isScope() const override;
Andreas Hubera2723d22016-07-29 15:36:07 -070024 bool containsSingleInterface(std::string *ifaceName) const;
Andreas Huberc9410c72016-07-28 12:18:40 -070025
26private:
27 Vector<Type *> mTypes;
28 KeyedVector<std::string, size_t> mTypeIndexByName;
29
30 KeyedVector<std::string, Constant *> mConstants;
31
32 DISALLOW_COPY_AND_ASSIGN(Scope);
33};
34
35} // namespace android
36
37#endif // SCOPE_H_
38