All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RouteRepository.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 <vector>
8 
9 namespace Eegeo
10 {
11  namespace Routes
12  {
14  {
15  private:
16  std::vector<const Route*> m_routes;
17  std::vector<IRouteCallback*> m_routeAddedCallbacks;
18  std::vector<IRouteCallback*> m_routeRemovedCallbacks;
19 
20  void FireCallbacks(std::vector<IRouteCallback*>& callbacks, const Route* route);
21  void InsertCallback(std::vector<IRouteCallback*>& callbacks, IRouteCallback* callback);
22  void RemoveCallback(std::vector<IRouteCallback*>& callbacks, IRouteCallback* callback);
23 
24  public:
25  void AddRoute(const Route* route);
26  bool RemoveRoute(const Route* route);
27  void RemoveAll();
28  std::vector<const Route*> GetRoutes() const;
29  bool IsEmpty() const;
30 
31  void RegisterRouteAddedCallback(IRouteCallback* callback);
32  void RegisterRouteRemovalCallback(IRouteCallback* callback);
33  void UnregisterRouteAddedCallback(IRouteCallback* callback);
34  void UnregisterRouteRemovalCallback(IRouteCallback* callback);
35  };
36  }
37 }