MCPcopy Create free account
hub / github.com/comaps/comaps / Read

Method Read

generator/collector_camera.cpp:62–79  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

60
61// static
62CameraCollector::CameraInfo CameraCollector::CameraInfo::Read(ReaderSource<FileReader> & src)
63{
64 /// @todo Take out intermediate camera info serialization code.
65 /// Should be equal with CamerasInfoCollector::ParseIntermediateInfo.
66
67 CameraInfo camera;
68 auto const latInt = ReadPrimitiveFromSource<uint32_t>(src);
69 auto const lonInt = ReadPrimitiveFromSource<uint32_t>(src);
70 camera.m_lat = Uint32ToDouble(latInt, ms::LatLon::kMinLat, ms::LatLon::kMaxLat, kPointCoordBits);
71 camera.m_lon = Uint32ToDouble(lonInt, ms::LatLon::kMinLon, ms::LatLon::kMaxLon, kPointCoordBits);
72 ReadPrimitiveFromSource(src, camera.m_speedKmPH);
73 auto relatedWaysNumber = ReadPrimitiveFromSource<uint32_t>(src);
74 camera.m_ways.reserve(relatedWaysNumber);
75 while (relatedWaysNumber--)
76 camera.m_ways.push_back(ReadPrimitiveFromSource<uint64_t>(src));
77
78 return camera;
79}
80
81// static
82void CameraCollector::CameraInfo::Write(FileWriter & writer, CameraInfo const & camera)

Callers

nothing calls this directly

Calls 4

Uint32ToDoubleFunction · 0.85
ReadPrimitiveFromSourceFunction · 0.85
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected