{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/214309706","pull_request_review_id":151332338,"id":214309706,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDMwOTcwNg==","diff_hunk":"@@ -0,0 +1,179 @@\n+#pragma once\n+\n+#include \"routing/route.hpp\"\n+#include \"routing/routing_session.hpp\"\n+#include \"routing/segment.hpp\"\n+\n+#include \"coding/file_container.hpp\"\n+#include \"coding/file_writer.hpp\"\n+#include \"coding/pointd_to_pointu.hpp\"\n+#include \"coding/reader.hpp\"\n+#include \"coding/varint.hpp\"\n+#include \"coding/write_to_sink.hpp\"\n+\n+#include \"geometry/point2d.hpp\"\n+\n+#include \"base/assert.hpp\"\n+\n+#include <cstdint>\n+#include <limits>\n+#include <map>\n+#include <string>\n+#include <utility>\n+#include <vector>\n+\n+namespace routing\n+{\n+static uint8_t constexpr kMaxCameraSpeedKmpH = std::numeric_limits<uint8_t>::max();\n+\n+/// \\brief |m_featureId| and |m_segmentId| identify the place where the camera is located.\n+/// |m_coef| is a factor [0, 1] where the camera is placed at the segment. |m_coef| == 0\n+/// means the camera is placed at the beginning of the segment.\n+struct SpeedCameraMwmPosition\n+{\n+  SpeedCameraMwmPosition() = default;\n+  SpeedCameraMwmPosition(uint32_t fId, uint32_t sId, double k)\n+    : m_featureId(fId), m_segmentId(sId), m_coef(k) {}\n+\n+  uint32_t m_featureId = 0;\n+  uint32_t m_segmentId = 0;\n+  double m_coef = 0.0;\n+};\n+\n+// Don't touch the order of enum (this is will be part of mwm).\n+// TODO (@gmoryes) change comment after adding section in mwm.\n+enum class SpeedCameraDirection\n+{\n+  Unknown = 0,\n+  Forward = 1,\n+  Backward = 2,\n+  Both = 3\n+};\n+\n+struct SpeedCameraMetadata\n+{\n+  SpeedCameraMetadata() = default;\n+  SpeedCameraMetadata(m2::PointD const & center, uint8_t maxSpeed,\n+                      std::vector<routing::SpeedCameraMwmPosition> && ways)\n+    : m_center(center), m_maxSpeedKmPH(maxSpeed), m_ways(std::move(ways)) {}\n+\n+  m2::PointD m_center;\n+  uint8_t m_maxSpeedKmPH = 0;\n+  std::vector<routing::SpeedCameraMwmPosition> m_ways;\n+  SpeedCameraDirection m_direction = SpeedCameraDirection::Unknown;\n+};\n+\n+class SpeedCameraMwmHeader\n+{\n+public:\n+  static uint32_t constexpr kLatestVersion = 0;\n+\n+  void SetVersion(uint32_t version) { m_version = version; }\n+  void SetAmount(uint32_t amount) { m_amount = amount; }\n+  uint32_t GetAmount() const { return m_amount; }\n+\n+  template <typename T>\n+  void Serialize(T & sink) const\n+  {\n+    WriteToSink(sink, m_version);\n+    WriteToSink(sink, m_amount);\n+  }\n+\n+  template <typename T>\n+  void Deserialize(T & sink)\n+  {\n+    ReadPrimitiveFromSource(sink, m_version);\n+    ReadPrimitiveFromSource(sink, m_amount);\n+  }\n+\n+  bool IsValid() const { return m_version <= kLatestVersion; }\n+\n+private:\n+  uint32_t m_version = 0;\n+  uint32_t m_amount = 0;\n+};\n+\n+struct SegmentCoord\n+{\n+  SegmentCoord() = default;\n+  SegmentCoord(uint32_t fId, uint32_t sId) : m_featureId(fId), m_segmentId(sId) {}\n+\n+  friend bool operator<(SegmentCoord const & lhs, SegmentCoord const & rhs)","path":"routing/speed_camera_ser_des.hpp","position":101,"original_position":101,"commit_id":"786606899c51630ff2e3faf09154a03a03932e2c","original_commit_id":"786606899c51630ff2e3faf09154a03a03932e2c","user":{"login":"mpimenov","id":10366009,"node_id":"MDQ6VXNlcjEwMzY2MDA5","avatar_url":"https://avatars0.githubusercontent.com/u/10366009?v=4","gravatar_id":"","url":"https://api.github.com/users/mpimenov","html_url":"https://github.com/mpimenov","followers_url":"https://api.github.com/users/mpimenov/followers","following_url":"https://api.github.com/users/mpimenov/following{/other_user}","gists_url":"https://api.github.com/users/mpimenov/gists{/gist_id}","starred_url":"https://api.github.com/users/mpimenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpimenov/subscriptions","organizations_url":"https://api.github.com/users/mpimenov/orgs","repos_url":"https://api.github.com/users/mpimenov/repos","events_url":"https://api.github.com/users/mpimenov/events{/privacy}","received_events_url":"https://api.github.com/users/mpimenov/received_events","type":"User","site_admin":false},"body":"Зачем здесь friend?","created_at":"2018-08-31T10:23:02Z","updated_at":"2018-08-31T10:26:51Z","html_url":"https://github.com/mapsme/omim/pull/9330#discussion_r214309706","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/9330","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/214309706"},"html":{"href":"https://github.com/mapsme/omim/pull/9330#discussion_r214309706"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9330"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/9330","id":209161114,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MTYxMTE0","html_url":"https://github.com/mapsme/omim/pull/9330","diff_url":"https://github.com/mapsme/omim/pull/9330.diff","patch_url":"https://github.com/mapsme/omim/pull/9330.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/9330","number":9330,"state":"open","locked":false,"title":"[routing] Add speed camera section (GENERATOR)","user":{"login":"gmoryes","id":17534533,"node_id":"MDQ6VXNlcjE3NTM0NTMz","avatar_url":"https://avatars2.githubusercontent.com/u/17534533?v=4","gravatar_id":"","url":"https://api.github.com/users/gmoryes","html_url":"https://github.com/gmoryes","followers_url":"https://api.github.com/users/gmoryes/followers","following_url":"https://api.github.com/users/gmoryes/following{/other_user}","gists_url":"https://api.github.com/users/gmoryes/gists{/gist_id}","starred_url":"https://api.github.com/users/gmoryes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmoryes/subscriptions","organizations_url":"https://api.github.com/users/gmoryes/orgs","repos_url":"https://api.github.com/users/gmoryes/repos","events_url":"https://api.github.com/users/gmoryes/events{/privacy}","received_events_url":"https://api.github.com/users/gmoryes/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-17T14:13:59Z","updated_at":"2018-08-31T10:26:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04bcbbec1d67b88c28d5bd075edecb27deeaa87d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/9330/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/9330/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/9330/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/786606899c51630ff2e3faf09154a03a03932e2c","head":{"label":"gmoryes:MAPSME-8120.speed_cam.GENERATOR_PART","ref":"MAPSME-8120.speed_cam.GENERATOR_PART","sha":"786606899c51630ff2e3faf09154a03a03932e2c","user":{"login":"gmoryes","id":17534533,"node_id":"MDQ6VXNlcjE3NTM0NTMz","avatar_url":"https://avatars2.githubusercontent.com/u/17534533?v=4","gravatar_id":"","url":"https://api.github.com/users/gmoryes","html_url":"https://github.com/gmoryes","followers_url":"https://api.github.com/users/gmoryes/followers","following_url":"https://api.github.com/users/gmoryes/following{/other_user}","gists_url":"https://api.github.com/users/gmoryes/gists{/gist_id}","starred_url":"https://api.github.com/users/gmoryes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmoryes/subscriptions","organizations_url":"https://api.github.com/users/gmoryes/orgs","repos_url":"https://api.github.com/users/gmoryes/repos","events_url":"https://api.github.com/users/gmoryes/events{/privacy}","received_events_url":"https://api.github.com/users/gmoryes/received_events","type":"User","site_admin":false},"repo":{"id":141252817,"node_id":"MDEwOlJlcG9zaXRvcnkxNDEyNTI4MTc=","name":"omim","full_name":"gmoryes/omim","owner":{"login":"gmoryes","id":17534533,"node_id":"MDQ6VXNlcjE3NTM0NTMz","avatar_url":"https://avatars2.githubusercontent.com/u/17534533?v=4","gravatar_id":"","url":"https://api.github.com/users/gmoryes","html_url":"https://github.com/gmoryes","followers_url":"https://api.github.com/users/gmoryes/followers","following_url":"https://api.github.com/users/gmoryes/following{/other_user}","gists_url":"https://api.github.com/users/gmoryes/gists{/gist_id}","starred_url":"https://api.github.com/users/gmoryes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmoryes/subscriptions","organizations_url":"https://api.github.com/users/gmoryes/orgs","repos_url":"https://api.github.com/users/gmoryes/repos","events_url":"https://api.github.com/users/gmoryes/events{/privacy}","received_events_url":"https://api.github.com/users/gmoryes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gmoryes/omim","description":"🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android","fork":true,"url":"https://api.github.com/repos/gmoryes/omim","forks_url":"https://api.github.com/repos/gmoryes/omim/forks","keys_url":"https://api.github.com/repos/gmoryes/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gmoryes/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gmoryes/omim/teams","hooks_url":"https://api.github.com/repos/gmoryes/omim/hooks","issue_events_url":"https://api.github.com/repos/gmoryes/omim/issues/events{/number}","events_url":"https://api.github.com/repos/gmoryes/omim/events","assignees_url":"https://api.github.com/repos/gmoryes/omim/assignees{/user}","branches_url":"https://api.github.com/repos/gmoryes/omim/branches{/branch}","tags_url":"https://api.github.com/repos/gmoryes/omim/tags","blobs_url":"https://api.github.com/repos/gmoryes/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gmoryes/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gmoryes/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/gmoryes/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gmoryes/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/gmoryes/omim/languages","stargazers_url":"https://api.github.com/repos/gmoryes/omim/stargazers","contributors_url":"https://api.github.com/repos/gmoryes/omim/contributors","subscribers_url":"https://api.github.com/repos/gmoryes/omim/subscribers","subscription_url":"https://api.github.com/repos/gmoryes/omim/subscription","commits_url":"https://api.github.com/repos/gmoryes/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/gmoryes/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/gmoryes/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/gmoryes/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/gmoryes/omim/contents/{+path}","compare_url":"https://api.github.com/repos/gmoryes/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gmoryes/omim/merges","archive_url":"https://api.github.com/repos/gmoryes/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gmoryes/omim/downloads","issues_url":"https://api.github.com/repos/gmoryes/omim/issues{/number}","pulls_url":"https://api.github.com/repos/gmoryes/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/gmoryes/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/gmoryes/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gmoryes/omim/labels{/name}","releases_url":"https://api.github.com/repos/gmoryes/omim/releases{/id}","deployments_url":"https://api.github.com/repos/gmoryes/omim/deployments","created_at":"2018-07-17T07:57:11Z","updated_at":"2018-08-22T09:46:37Z","pushed_at":"2018-08-31T09:37:35Z","git_url":"git://github.com/gmoryes/omim.git","ssh_url":"git@github.com:gmoryes/omim.git","clone_url":"https://github.com/gmoryes/omim.git","svn_url":"https://github.com/gmoryes/omim","homepage":"","size":4049406,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"ae25bf71ca921f6860aa836635e5ef7bbf3013f9","user":{"login":"mapsme","id":14185141,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTg1MTQx","avatar_url":"https://avatars1.githubusercontent.com/u/14185141?v=4","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"node_id":"MDEwOlJlcG9zaXRvcnk0Mjc5ODAzMw==","name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTg1MTQx","avatar_url":"https://avatars1.githubusercontent.com/u/14185141?v=4","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2018-08-31T07:53:01Z","pushed_at":"2018-08-31T09:37:37Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":"","size":4055380,"stargazers_count":2763,"watchers_count":2763,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":599,"mirror_url":null,"archived":false,"open_issues_count":729,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":599,"open_issues":729,"watchers":2763,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9330"},"html":{"href":"https://github.com/mapsme/omim/pull/9330"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/9330"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/9330/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9330/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/9330/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/786606899c51630ff2e3faf09154a03a03932e2c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mpimenov"}}