All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TrafficThemeController.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "CityThemes.h"
7 #include "ICityThemeChangedObserver.h"
8 #include "ICityThemeStateObserver.h"
9 #include "Traffic.h"
10 #include "AsyncModels.h"
11 
12 #include <set>
13 #include <map>
14 #include <string>
15 
16 namespace Eegeo
17 {
18  namespace Traffic
19  {
20  namespace Themes
21  {
23  : protected Eegeo::NonCopyable
26  {
27  public:
29  Io::AsyncModels::HttpAsyncModelLoader& asyncModelLoader,
30  TrafficThemeModel& trafficThemeModel,
31  Traffic::VehicleModelNodeRepository& vehicleModelNodeRepository,
34 
36 
37  void OnThemeRequested(const Eegeo::Resources::CityThemes::CityThemeData& newTheme);
38  void OnThemeChanged(const Eegeo::Resources::CityThemes::CityThemeData& newTheme);
39  void OnThemeStateChanged(const Eegeo::Resources::CityThemes::CityThemeState& state);
40 
41  private:
42  void ClearLoadedModels();
43 
44  void LoadModelsFromConfig(
46  std::set<std::string> nodeSuffixes);
47 
48  void GatherVehicleSuffixesForStates(
49  std::map<std::string,Resources::CityThemes::CityThemeState> themeStates,
50  std::set<std::string> &suffixes);
51 
52  void LoadModelsFromTheme(const Eegeo::Resources::CityThemes::CityThemeData& theme);
53 
54  typedef std::vector<Io::AsyncModels::IAsyncModel*> TAsyncModels;
55  TAsyncModels m_asyncModels;
56  Io::AsyncModels::HttpAsyncModelLoader& m_asyncModelLoader;
57  TrafficThemeModel& m_trafficThemeModel;
58  Traffic::VehicleModelNodeRepository& m_vehicleModelNodeRepository;
61  };
62  }
63  }
64 }