Game Develop C++ Platform: DependenciesAnalyzer.h Source File

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
DependenciesAnalyzer.h
Go to the documentation of this file.
1
5 #if defined(GD_IDE_ONLY)
6 #ifndef DEPENDENCIESANALYZER_H
7 #define DEPENDENCIESANALYZER_H
8 #include <set>
9 #include <string>
10 #include <vector>
11 #include <boost/shared_ptr.hpp>
12 namespace gd { class BaseEvent; }
13 namespace gd { class Project; }
14 namespace gd { class Layout; }
15 namespace gd { class ExternalEvents; }
16
20 class DependenciesAnalyzer
21 {
22 public:
23
27 DependenciesAnalyzer(gd::Project & project_, gd::Layout & layout_);
28
36 DependenciesAnalyzer(gd::Project & project_, gd::ExternalEvents & externalEvents);
37
38 virtual ~DependenciesAnalyzer();
39
46 bool Analyze();
47
56 std::string ExternalEventsCanBeCompiledForAScene();
57
61 const std::set< std::string > & GetScenesDependencies() const { return scenesDependencies; };
62
66 const std::set< std::string > & GetExternalEventsDependencies() const { return externalEventsDependencies; };
67
71 const std::set< std::string > & GetSourceFilesDependencies() const { return sourceFilesDependencies; };
72
77 const std::set< std::string > & GetNotTopLevelScenesDependencies() const { return notTopLevelScenesDependencies; };
78
83 const std::set< std::string > & GetNotTopLevelExternalEventsDependencies() const { return notTopLevelExternalEventsDependencies; };
84
85 private:
93 bool Analyze(std::vector< boost::shared_ptr<gd::BaseEvent> > & events, bool isOnTopLevel);
94
98 DependenciesAnalyzer(const DependenciesAnalyzer & parent);
99
100 void AddParentScene(std::string parentScene) { parentScenes.push_back(parentScene); };
101 void AddParentExternalEvents(std::string parentExternalEvents_) { parentExternalEvents.push_back(parentExternalEvents_); };
102
109 bool CheckIfExternalEventsIsLinkedOnlyAtTopLevel(const std::string & externalEventsName, std::vector< boost::shared_ptr<gd::BaseEvent> > & events);
110
111 std::set< std::string > scenesDependencies;
112 std::set< std::string > externalEventsDependencies;
113 std::set< std::string > sourceFilesDependencies;
114 std::set< std::string > notTopLevelScenesDependencies;
115 std::set< std::string > notTopLevelExternalEventsDependencies;
116 std::vector<std::string> parentScenes;
117 std::vector<std::string> parentExternalEvents;
118
119 gd::Project & project;
120 gd::Layout * layout;
121 gd::ExternalEvents * externalEvents;
122 };
123
124 #endif // DEPENDENCIESANALYZER_H
125 #endif