All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TrafficCongestionModel.h
1 // Copyright (c) 2014 eeGeo. All rights reserved.
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "TrafficCongestion.h"
7 #include "TrafficCongestionConfig.h"
8 #include "MortonKey.h"
9 #include "TrafficCongestionModelCell.h"
10 
11 #include <map>
12 #include <vector>
13 
14 namespace Eegeo
15 {
16  namespace TrafficCongestion
17  {
19  {
20  public:
21  typedef std::map<Eegeo::Streaming::MortonKey, TrafficCongestionModelCell*, Streaming::MortonKeyCompare> TKeyToModelCell;
22  typedef std::vector<ITrafficCongestionStateChangedCallback*> TCallbacks;
23 
24  void RegisterCongestionChangedCallback(ITrafficCongestionStateChangedCallback* callback);
25 
26  void UnregisterCongestionChangedCallback(ITrafficCongestionStateChangedCallback* callback);
27 
28  void SetCongestion(
29  const Eegeo::Streaming::MortonKey& key,
30  const int roadId,
31  const Eegeo::TrafficCongestion::CongestionLevel::CongestionLevelValues severity);
32 
33  bool TryGetCell(
34  const Streaming::MortonKey& key,
35  const TrafficCongestion::TrafficCongestionModelCell*& out_pCell) const;
36 
37  private:
38  TKeyToModelCell m_keyToModelCell;
39  TCallbacks m_callbacks;
40  };
41  }
42 }