{"action":"created","comment":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/comments/125603017","pull_request_review_id":47998682,"id":125603017,"diff_hunk":"@@ -175,6 +175,38 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti\n         }\n     }\n \n+    const auto classStringToMask = [this](const std::string &class_name) {\n+        auto iter = classes_map.find(class_name);\n+        if (iter == classes_map.end())\n+        {\n+            if (classes_map.size() > MAX_CLASS_INDEX)\n+            {\n+                throw util::exception(\"Maximum number of classes if \" +\n+                                      std::to_string(MAX_CLASS_INDEX + 1));\n+            }\n+            ClassData class_mask = 1u << classes_map.size();\n+            classes_map[class_name] = class_mask;\n+            return class_mask;\n+        }\n+        else\n+        {\n+            return iter->second;\n+        }\n+    };\n+    const auto classesToMask = [&](const auto &classes) {\n+        ClassData mask = 0;\n+        for (const auto &pair : classes)\n+        {\n+            if (pair.second)\n+            {\n+                mask |= classStringToMask(pair.first);\n+            }\n+        }\n+        return mask;\n+    };","path":"src/extractor/extractor_callbacks.cpp","position":32,"original_position":32,"commit_id":"2606e8eb2d407e4039fbbd1aaef34ca7fe6e2a8c","original_commit_id":"2606e8eb2d407e4039fbbd1aaef34ca7fe6e2a8c","user":{"login":"daniel-j-h","id":527241,"avatar_url":"https://avatars0.githubusercontent.com/u/527241?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-j-h","html_url":"https://github.com/daniel-j-h","followers_url":"https://api.github.com/users/daniel-j-h/followers","following_url":"https://api.github.com/users/daniel-j-h/following{/other_user}","gists_url":"https://api.github.com/users/daniel-j-h/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-j-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-j-h/subscriptions","organizations_url":"https://api.github.com/users/daniel-j-h/orgs","repos_url":"https://api.github.com/users/daniel-j-h/repos","events_url":"https://api.github.com/users/daniel-j-h/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-j-h/received_events","type":"User","site_admin":false},"body":"Hm this is a bit hard to follow with the auto and first/second working on basically arbitrary types - can you make it a bit more explicit?","created_at":"2017-07-05T10:02:02Z","updated_at":"2017-07-05T10:04:44Z","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/4204#discussion_r125603017","pull_request_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/4204","_links":{"self":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/comments/125603017"},"html":{"href":"https://github.com/Project-OSRM/osrm-backend/pull/4204#discussion_r125603017"},"pull_request":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/4204"}}},"pull_request":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/4204","id":127803214,"html_url":"https://github.com/Project-OSRM/osrm-backend/pull/4204","diff_url":"https://github.com/Project-OSRM/osrm-backend/pull/4204.diff","patch_url":"https://github.com/Project-OSRM/osrm-backend/pull/4204.patch","issue_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/4204","number":4204,"state":"open","locked":false,"title":"Allow users to specify a class for each way","user":{"login":"TheMarex","id":606968,"avatar_url":"https://avatars3.githubusercontent.com/u/606968?v=3","gravatar_id":"","url":"https://api.github.com/users/TheMarex","html_url":"https://github.com/TheMarex","followers_url":"https://api.github.com/users/TheMarex/followers","following_url":"https://api.github.com/users/TheMarex/following{/other_user}","gists_url":"https://api.github.com/users/TheMarex/gists{/gist_id}","starred_url":"https://api.github.com/users/TheMarex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheMarex/subscriptions","organizations_url":"https://api.github.com/users/TheMarex/orgs","repos_url":"https://api.github.com/users/TheMarex/repos","events_url":"https://api.github.com/users/TheMarex/events{/privacy}","received_events_url":"https://api.github.com/users/TheMarex/received_events","type":"User","site_admin":false},"body":"This PR implements #4203 as a first step toward #4006.  We now allow users to mark ways with a specific class in the profile and expose this information in JSON response.\r\n\r\n## Tasklist\r\n - [x] move `ClassData` to own header\r\n - [x] add tests for new JSON response property\r\n - [x] emit `Notification` instructions on class changes. \r\n - [ ] review\r\n - [ ] adjust for comments\r\n","created_at":"2017-06-27T22:06:20Z","updated_at":"2017-07-05T10:04:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1eadc652abfa98e60f71a17dd0334902a2a83230","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/milestones/37","html_url":"https://github.com/Project-OSRM/osrm-backend/milestone/37","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/milestones/37/labels","id":2500787,"number":37,"title":"5.9.0","description":null,"creator":{"login":"TheMarex","id":606968,"avatar_url":"https://avatars3.githubusercontent.com/u/606968?v=3","gravatar_id":"","url":"https://api.github.com/users/TheMarex","html_url":"https://github.com/TheMarex","followers_url":"https://api.github.com/users/TheMarex/followers","following_url":"https://api.github.com/users/TheMarex/following{/other_user}","gists_url":"https://api.github.com/users/TheMarex/gists{/gist_id}","starred_url":"https://api.github.com/users/TheMarex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheMarex/subscriptions","organizations_url":"https://api.github.com/users/TheMarex/orgs","repos_url":"https://api.github.com/users/TheMarex/repos","events_url":"https://api.github.com/users/TheMarex/events{/privacy}","received_events_url":"https://api.github.com/users/TheMarex/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":2,"state":"open","created_at":"2017-05-04T20:05:20Z","updated_at":"2017-07-04T20:58:20Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/4204/commits","review_comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/4204/comments","review_comment_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/4204/comments","statuses_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/statuses/2606e8eb2d407e4039fbbd1aaef34ca7fe6e2a8c","head":{"label":"Project-OSRM:feature/extract_classes","ref":"feature/extract_classes","sha":"2606e8eb2d407e4039fbbd1aaef34ca7fe6e2a8c","user":{"login":"Project-OSRM","id":8207060,"avatar_url":"https://avatars0.githubusercontent.com/u/8207060?v=3","gravatar_id":"","url":"https://api.github.com/users/Project-OSRM","html_url":"https://github.com/Project-OSRM","followers_url":"https://api.github.com/users/Project-OSRM/followers","following_url":"https://api.github.com/users/Project-OSRM/following{/other_user}","gists_url":"https://api.github.com/users/Project-OSRM/gists{/gist_id}","starred_url":"https://api.github.com/users/Project-OSRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Project-OSRM/subscriptions","organizations_url":"https://api.github.com/users/Project-OSRM/orgs","repos_url":"https://api.github.com/users/Project-OSRM/repos","events_url":"https://api.github.com/users/Project-OSRM/events{/privacy}","received_events_url":"https://api.github.com/users/Project-OSRM/received_events","type":"Organization","site_admin":false},"repo":{"id":2436255,"name":"osrm-backend","full_name":"Project-OSRM/osrm-backend","owner":{"login":"Project-OSRM","id":8207060,"avatar_url":"https://avatars0.githubusercontent.com/u/8207060?v=3","gravatar_id":"","url":"https://api.github.com/users/Project-OSRM","html_url":"https://github.com/Project-OSRM","followers_url":"https://api.github.com/users/Project-OSRM/followers","following_url":"https://api.github.com/users/Project-OSRM/following{/other_user}","gists_url":"https://api.github.com/users/Project-OSRM/gists{/gist_id}","starred_url":"https://api.github.com/users/Project-OSRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Project-OSRM/subscriptions","organizations_url":"https://api.github.com/users/Project-OSRM/orgs","repos_url":"https://api.github.com/users/Project-OSRM/repos","events_url":"https://api.github.com/users/Project-OSRM/events{/privacy}","received_events_url":"https://api.github.com/users/Project-OSRM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Project-OSRM/osrm-backend","description":"Open Source Routing Machine - C++ backend","fork":false,"url":"https://api.github.com/repos/Project-OSRM/osrm-backend","forks_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/forks","keys_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/teams","hooks_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/hooks","issue_events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/events{/number}","events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/events","assignees_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/assignees{/user}","branches_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/branches{/branch}","tags_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/tags","blobs_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/languages","stargazers_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/stargazers","contributors_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/contributors","subscribers_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/subscribers","subscription_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/subscription","commits_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/contents/{+path}","compare_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/merges","archive_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/downloads","issues_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues{/number}","pulls_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/labels{/name}","releases_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/releases{/id}","deployments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/deployments","created_at":"2011-09-22T10:05:08Z","updated_at":"2017-07-04T15:55:19Z","pushed_at":"2017-07-05T07:57:50Z","git_url":"git://github.com/Project-OSRM/osrm-backend.git","ssh_url":"git@github.com:Project-OSRM/osrm-backend.git","clone_url":"https://github.com/Project-OSRM/osrm-backend.git","svn_url":"https://github.com/Project-OSRM/osrm-backend","homepage":"http://map.project-osrm.org","size":39641,"stargazers_count":1790,"watchers_count":1790,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1012,"mirror_url":null,"open_issues_count":387,"forks":1012,"open_issues":387,"watchers":1790,"default_branch":"master"}},"base":{"label":"Project-OSRM:master","ref":"master","sha":"e47e8ed335c5c4ec890005299c4f51c50be12ada","user":{"login":"Project-OSRM","id":8207060,"avatar_url":"https://avatars0.githubusercontent.com/u/8207060?v=3","gravatar_id":"","url":"https://api.github.com/users/Project-OSRM","html_url":"https://github.com/Project-OSRM","followers_url":"https://api.github.com/users/Project-OSRM/followers","following_url":"https://api.github.com/users/Project-OSRM/following{/other_user}","gists_url":"https://api.github.com/users/Project-OSRM/gists{/gist_id}","starred_url":"https://api.github.com/users/Project-OSRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Project-OSRM/subscriptions","organizations_url":"https://api.github.com/users/Project-OSRM/orgs","repos_url":"https://api.github.com/users/Project-OSRM/repos","events_url":"https://api.github.com/users/Project-OSRM/events{/privacy}","received_events_url":"https://api.github.com/users/Project-OSRM/received_events","type":"Organization","site_admin":false},"repo":{"id":2436255,"name":"osrm-backend","full_name":"Project-OSRM/osrm-backend","owner":{"login":"Project-OSRM","id":8207060,"avatar_url":"https://avatars0.githubusercontent.com/u/8207060?v=3","gravatar_id":"","url":"https://api.github.com/users/Project-OSRM","html_url":"https://github.com/Project-OSRM","followers_url":"https://api.github.com/users/Project-OSRM/followers","following_url":"https://api.github.com/users/Project-OSRM/following{/other_user}","gists_url":"https://api.github.com/users/Project-OSRM/gists{/gist_id}","starred_url":"https://api.github.com/users/Project-OSRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Project-OSRM/subscriptions","organizations_url":"https://api.github.com/users/Project-OSRM/orgs","repos_url":"https://api.github.com/users/Project-OSRM/repos","events_url":"https://api.github.com/users/Project-OSRM/events{/privacy}","received_events_url":"https://api.github.com/users/Project-OSRM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Project-OSRM/osrm-backend","description":"Open Source Routing Machine - C++ backend","fork":false,"url":"https://api.github.com/repos/Project-OSRM/osrm-backend","forks_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/forks","keys_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/teams","hooks_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/hooks","issue_events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/events{/number}","events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/events","assignees_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/assignees{/user}","branches_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/branches{/branch}","tags_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/tags","blobs_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/languages","stargazers_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/stargazers","contributors_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/contributors","subscribers_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/subscribers","subscription_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/subscription","commits_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/contents/{+path}","compare_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/merges","archive_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/downloads","issues_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues{/number}","pulls_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/labels{/name}","releases_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/releases{/id}","deployments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/deployments","created_at":"2011-09-22T10:05:08Z","updated_at":"2017-07-04T15:55:19Z","pushed_at":"2017-07-05T07:57:50Z","git_url":"git://github.com/Project-OSRM/osrm-backend.git","ssh_url":"git@github.com:Project-OSRM/osrm-backend.git","clone_url":"https://github.com/Project-OSRM/osrm-backend.git","svn_url":"https://github.com/Project-OSRM/osrm-backend","homepage":"http://map.project-osrm.org","size":39641,"stargazers_count":1790,"watchers_count":1790,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1012,"mirror_url":null,"open_issues_count":387,"forks":1012,"open_issues":387,"watchers":1790,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/4204"},"html":{"href":"https://github.com/Project-OSRM/osrm-backend/pull/4204"},"issue":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/4204"},"comments":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/4204/comments"},"review_comments":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/4204/comments"},"review_comment":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/4204/commits"},"statuses":{"href":"https://api.github.com/repos/Project-OSRM/osrm-backend/statuses/2606e8eb2d407e4039fbbd1aaef34ca7fe6e2a8c"}}}}
{"actor":{"display_login":"daniel-j-h"}}