mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 22:53:43 +00:00
committed by
Konstantin Pastbin
parent
c9cbb64f12
commit
76ffc99abd
39
libs/routing/fake_edges_container.hpp
Normal file
39
libs/routing/fake_edges_container.hpp
Normal file
@@ -0,0 +1,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(std::move(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 m_fake;
|
||||
};
|
||||
} // namespace routing
|
||||
Reference in New Issue
Block a user