All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RouteStyleRepository.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Routes.h"
7 #include "RouteStyle.h"
8 #include <map>
9 #include <vector>
10 
11 namespace Eegeo
12 {
13  namespace Routes
14  {
16  {
17  private:
18  std::map<const Route*, Style::RouteStyle> m_routeStyleMap;
19  std::vector<View::IRouteViewStyleCallback*> m_styleChangedCallbacks;
20 
21  typedef std::vector<View::IRouteViewStyleCallback*>::iterator TCallbackIter;
22 
23  void FireCallbacks(std::vector<View::IRouteViewStyleCallback*>& callbacks, const Route* route, const Style::RouteStyle& routeStyle);
24  void InsertCallback(std::vector<View::IRouteViewStyleCallback*>& callbacks, View::IRouteViewStyleCallback* callback);
25  void RemoveCallback(std::vector<View::IRouteViewStyleCallback*>& callbacks, View::IRouteViewStyleCallback* callback);
26  public:
27  void AddRouteStyleMapping(const Route* pRoute, Style::RouteStyle routeStyle);
28  void SetRouteStyleMapping(const Route* pRoute, Style::RouteStyle routeStyle);
29  void RemoveRouteStyleMapping(const Route* pRoute);
30 
31  bool HasStyleForRoute(const Route* route) const;
32  Style::RouteStyle GetStyleForRoute(const Route* route) const;
33  bool IsEmpty() const;
34 
35  void RegisterStyleChangedCallback(View::IRouteViewStyleCallback* callback);
36  void UnregisterStyleChangedCallback(View::IRouteViewStyleCallback* callback);
37  };
38  }
39 }