All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TrafficSimulationCellsModel.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "MortonKey.h"
7 #include "Traffic.h"
8 #include <map>
9 
10 namespace Eegeo
11 {
12  namespace Traffic
13  {
15  {
16  public:
17 
18  typedef std::map<Eegeo::Streaming::MortonKey, TrafficSimulationCell*, Eegeo::Streaming::MortonKeyCompare> TTrafficCellMap;
19  typedef TTrafficCellMap::const_iterator TTrafficCellConstIterator;
20 
21  TrafficSimulationCellsModel(bool managePopulation)
22  : m_managePopulation(managePopulation)
23  {
24 
25  }
26 
27  TTrafficCellConstIterator Begin() const { return m_storage.begin(); }
28  TTrafficCellConstIterator End() const { return m_storage.end(); }
29 
30  void AddCell(const Streaming::MortonKey& key, TrafficSimulationCell* cell);
31  void RemoveCell(const Streaming::MortonKey& key);
32  TrafficSimulationCell* GetCellWithKey(const Streaming::MortonKey& key) const;
33  void Clear();
34 
35  bool ShouldManagePopulation() const { return m_managePopulation; }
36 
37  private:
38 
39  TTrafficCellMap m_storage;
40 
41  bool m_managePopulation;
42  };
43  }
44 }