Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fake_edges_container.hpp « routing - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9b9a7567cb245f692abe24a0ae19cf04931d1944 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include "routing/fake_graph.hpp"
#include "routing/fake_vertex.hpp"
#include "routing/index_graph_starter.hpp"
#include "routing/segment.hpp"

#include <cstddef>
#include <cstdint>
#include <limits>
#include <utility>

namespace routing
{
class FakeEdgesContainer final
{
  friend class IndexGraphStarter;

public:
  FakeEdgesContainer(IndexGraphStarter && starter)
    : m_finish(starter.m_finish)
    , m_fake(std::move(starter.m_fake))
  {
  }

  uint32_t GetNumFakeEdges() const
  {
    // Maximal number of fake segments in fake graph is numeric_limits<uint32_t>::max()
    // because segment idx type is uint32_t.
    CHECK_LESS_OR_EQUAL(m_fake.GetSize(), std::numeric_limits<uint32_t>::max(), ());
    return static_cast<uint32_t>(m_fake.GetSize());
  }

private:
  // Finish ending.
  IndexGraphStarter::Ending m_finish;
  FakeGraph<Segment, FakeVertex> m_fake;
};
}  // namespace routing