blob: 8f72e7ed873549d56d504f7d1a040fd20cb012a1 [file] [log] [blame]
Andreas Huber5345ec22016-07-29 13:33:27 -07001#ifndef COORDINATOR_H_
2
3#define COORDINATOR_H_
4
5#include <android-base/macros.h>
6#include <string>
7#include <utils/KeyedVector.h>
8
9namespace android {
10
11struct AST;
12struct FQName;
13struct Type;
14
15struct Coordinator {
Andreas Huberdc981332016-07-29 15:46:54 -070016 Coordinator(const std::string &interfacesPath);
Andreas Huber5345ec22016-07-29 13:33:27 -070017 ~Coordinator();
18
Andreas Huber68f24592016-07-29 14:53:48 -070019 AST *parse(const FQName &fqName);
Andreas Huber5345ec22016-07-29 13:33:27 -070020
21 Type *lookupType(const FQName &fqName) const;
22
Andreas Huber881227d2016-08-02 14:20:21 -070023 std::string getPackagePath(
24 const FQName &fqName, bool relative = false) const;
Andreas Huber5345ec22016-07-29 13:33:27 -070025
26private:
Andreas Huberdc981332016-07-29 15:46:54 -070027 std::string mInterfacesPath;
Andreas Huber68f24592016-07-29 14:53:48 -070028 KeyedVector<FQName, AST *> mCache;
Andreas Huber5345ec22016-07-29 13:33:27 -070029
30 DISALLOW_COPY_AND_ASSIGN(Coordinator);
31};
32
33} // namespace android
34
35#endif // COORDINATOR_H_