{"action":"created","comment":{"url":"https://api.github.com/repos/CanalTP/navitia/pulls/comments/49878093","id":49878093,"diff_hunk":"@@ -34,6 +34,108 @@ www.navitia.io\n #include \"type/response.pb.h\"\n #include \"type/pt_data.h\"\n \n+namespace pt = boost::posix_time;\n+\n+// we don't use a boolean to have a more type checks\n+enum class DumpMessage {\n+    Yes,\n+    No\n+};\n+\n+#define null_time_period boost::posix_time::time_period(boost::posix_time::not_a_date_time, boost::posix_time::seconds(0))\n+\n+//*********************************************\n+\n+using house_number_coord = std::pair<int, const navitia::type::GeographicalCoord&>;\n+using way_name = std::pair<const navitia::georef::Way*, const std::string&>;\n+using way_pair = std::pair<const navitia::georef::Way*, house_number_coord>;\n+using way_pair_name = std::pair<way_name, house_number_coord>;\n+\n+namespace ProtoCreator {\n+\n+struct PbCreator {\n+    const nt::Data& data;\n+    const pt::ptime now;\n+    const pt::time_period action_period;\n+    const bool show_codes;\n+    PbCreator(const nt::Data& data, const pt::ptime  now, const pt::time_period action_period, const bool show_codes):\n+        data(data), now(now), action_period(action_period),show_codes(show_codes) {}\n+    template<typename N, typename P>\n+    void fill(int depth, const DumpMessage dump_message, const N* item, P * proto) {\n+        Filler(depth, dump_message, *this).fill_pb_object(item, proto);\n+    }\n+\n+private:\n+    struct Filler {\n+        int depth;\n+        const DumpMessage dump_message;\n+        PbCreator & pb_creator;\n+        Filler(int depth, const DumpMessage dump_message, PbCreator & pb_creator):\n+            depth(depth), dump_message(dump_message), pb_creator(pb_creator){};\n+\n+        Filler copy_depth_decr();\n+        template<typename NAV, typename PB>\n+        void fill(const NAV* nav_object, PB* pb_object) {\n+            copy_depth_decr().fill_pb_object(nav_object, pb_object);\n+        }\n+\n+        template<typename NAV, typename GetPbObject>\n+        void fill(const std::vector<NAV*>& nav_list, GetPbObject get_pb_object){","path":"source/type/pb_converter.h","position":50,"original_position":50,"commit_id":"9e95e6af6b4cd87fd8bb1e3242f983ccce844fde","original_commit_id":"9e95e6af6b4cd87fd8bb1e3242f983ccce844fde","user":{"login":"TeXitoi","id":5787066,"avatar_url":"https://avatars.githubusercontent.com/u/5787066?v=3","gravatar_id":"","url":"https://api.github.com/users/TeXitoi","html_url":"https://github.com/TeXitoi","followers_url":"https://api.github.com/users/TeXitoi/followers","following_url":"https://api.github.com/users/TeXitoi/following{/other_user}","gists_url":"https://api.github.com/users/TeXitoi/gists{/gist_id}","starred_url":"https://api.github.com/users/TeXitoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeXitoi/subscriptions","organizations_url":"https://api.github.com/users/TeXitoi/orgs","repos_url":"https://api.github.com/users/TeXitoi/repos","events_url":"https://api.github.com/users/TeXitoi/events{/privacy}","received_events_url":"https://api.github.com/users/TeXitoi/received_events","type":"User","site_admin":false},"body":"```c++\r\ntemplate<typename Nav, typename Pb>\r\nvoid fill (const std::vector<NAV*>& nav_list, ::google::protobuf::RepeatedPtrField< Pb >* pb_list) {\r\n    for (auto* nav_obj: nav_list) {\r\n        fill(nav_obj, pb_list.add());\r\n    }\r\n}\r\n```\r\nnot tested","created_at":"2016-01-15T17:09:21Z","updated_at":"2016-01-15T17:09:21Z","html_url":"https://github.com/CanalTP/navitia/pull/1367#discussion_r49878093","pull_request_url":"https://api.github.com/repos/CanalTP/navitia/pulls/1367","_links":{"self":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/comments/49878093"},"html":{"href":"https://github.com/CanalTP/navitia/pull/1367#discussion_r49878093"},"pull_request":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/1367"}}},"pull_request":{"url":"https://api.github.com/repos/CanalTP/navitia/pulls/1367","id":56048877,"html_url":"https://github.com/CanalTP/navitia/pull/1367","diff_url":"https://github.com/CanalTP/navitia/pull/1367.diff","patch_url":"https://github.com/CanalTP/navitia/pull/1367.patch","issue_url":"https://api.github.com/repos/CanalTP/navitia/issues/1367","number":1367,"state":"open","locked":false,"title":"kraken: refactoring pb_converter","user":{"login":"azime","id":4006603,"avatar_url":"https://avatars.githubusercontent.com/u/4006603?v=3","gravatar_id":"","url":"https://api.github.com/users/azime","html_url":"https://github.com/azime","followers_url":"https://api.github.com/users/azime/followers","following_url":"https://api.github.com/users/azime/following{/other_user}","gists_url":"https://api.github.com/users/azime/gists{/gist_id}","starred_url":"https://api.github.com/users/azime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azime/subscriptions","organizations_url":"https://api.github.com/users/azime/orgs","repos_url":"https://api.github.com/users/azime/repos","events_url":"https://api.github.com/users/azime/events{/privacy}","received_events_url":"https://api.github.com/users/azime/received_events","type":"User","site_admin":false},"body":"jira : http://jira.canaltp.fr/browse/NAVP-451","created_at":"2016-01-14T15:25:26Z","updated_at":"2016-01-15T17:09:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3227e931dc76a5264e5f83b9a408779120d0809f","assignee":{"login":"TeXitoi","id":5787066,"avatar_url":"https://avatars.githubusercontent.com/u/5787066?v=3","gravatar_id":"","url":"https://api.github.com/users/TeXitoi","html_url":"https://github.com/TeXitoi","followers_url":"https://api.github.com/users/TeXitoi/followers","following_url":"https://api.github.com/users/TeXitoi/following{/other_user}","gists_url":"https://api.github.com/users/TeXitoi/gists{/gist_id}","starred_url":"https://api.github.com/users/TeXitoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeXitoi/subscriptions","organizations_url":"https://api.github.com/users/TeXitoi/orgs","repos_url":"https://api.github.com/users/TeXitoi/repos","events_url":"https://api.github.com/users/TeXitoi/events{/privacy}","received_events_url":"https://api.github.com/users/TeXitoi/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/CanalTP/navitia/pulls/1367/commits","review_comments_url":"https://api.github.com/repos/CanalTP/navitia/pulls/1367/comments","review_comment_url":"https://api.github.com/repos/CanalTP/navitia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CanalTP/navitia/issues/1367/comments","statuses_url":"https://api.github.com/repos/CanalTP/navitia/statuses/9e95e6af6b4cd87fd8bb1e3242f983ccce844fde","head":{"label":"azime:refacto_pb_converter","ref":"refacto_pb_converter","sha":"9e95e6af6b4cd87fd8bb1e3242f983ccce844fde","user":{"login":"azime","id":4006603,"avatar_url":"https://avatars.githubusercontent.com/u/4006603?v=3","gravatar_id":"","url":"https://api.github.com/users/azime","html_url":"https://github.com/azime","followers_url":"https://api.github.com/users/azime/followers","following_url":"https://api.github.com/users/azime/following{/other_user}","gists_url":"https://api.github.com/users/azime/gists{/gist_id}","starred_url":"https://api.github.com/users/azime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azime/subscriptions","organizations_url":"https://api.github.com/users/azime/orgs","repos_url":"https://api.github.com/users/azime/repos","events_url":"https://api.github.com/users/azime/events{/privacy}","received_events_url":"https://api.github.com/users/azime/received_events","type":"User","site_admin":false},"repo":{"id":19149123,"name":"navitia","full_name":"azime/navitia","owner":{"login":"azime","id":4006603,"avatar_url":"https://avatars.githubusercontent.com/u/4006603?v=3","gravatar_id":"","url":"https://api.github.com/users/azime","html_url":"https://github.com/azime","followers_url":"https://api.github.com/users/azime/followers","following_url":"https://api.github.com/users/azime/following{/other_user}","gists_url":"https://api.github.com/users/azime/gists{/gist_id}","starred_url":"https://api.github.com/users/azime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azime/subscriptions","organizations_url":"https://api.github.com/users/azime/orgs","repos_url":"https://api.github.com/users/azime/repos","events_url":"https://api.github.com/users/azime/events{/privacy}","received_events_url":"https://api.github.com/users/azime/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/azime/navitia","description":"","fork":true,"url":"https://api.github.com/repos/azime/navitia","forks_url":"https://api.github.com/repos/azime/navitia/forks","keys_url":"https://api.github.com/repos/azime/navitia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azime/navitia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azime/navitia/teams","hooks_url":"https://api.github.com/repos/azime/navitia/hooks","issue_events_url":"https://api.github.com/repos/azime/navitia/issues/events{/number}","events_url":"https://api.github.com/repos/azime/navitia/events","assignees_url":"https://api.github.com/repos/azime/navitia/assignees{/user}","branches_url":"https://api.github.com/repos/azime/navitia/branches{/branch}","tags_url":"https://api.github.com/repos/azime/navitia/tags","blobs_url":"https://api.github.com/repos/azime/navitia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azime/navitia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azime/navitia/git/refs{/sha}","trees_url":"https://api.github.com/repos/azime/navitia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azime/navitia/statuses/{sha}","languages_url":"https://api.github.com/repos/azime/navitia/languages","stargazers_url":"https://api.github.com/repos/azime/navitia/stargazers","contributors_url":"https://api.github.com/repos/azime/navitia/contributors","subscribers_url":"https://api.github.com/repos/azime/navitia/subscribers","subscription_url":"https://api.github.com/repos/azime/navitia/subscription","commits_url":"https://api.github.com/repos/azime/navitia/commits{/sha}","git_commits_url":"https://api.github.com/repos/azime/navitia/git/commits{/sha}","comments_url":"https://api.github.com/repos/azime/navitia/comments{/number}","issue_comment_url":"https://api.github.com/repos/azime/navitia/issues/comments{/number}","contents_url":"https://api.github.com/repos/azime/navitia/contents/{+path}","compare_url":"https://api.github.com/repos/azime/navitia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azime/navitia/merges","archive_url":"https://api.github.com/repos/azime/navitia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azime/navitia/downloads","issues_url":"https://api.github.com/repos/azime/navitia/issues{/number}","pulls_url":"https://api.github.com/repos/azime/navitia/pulls{/number}","milestones_url":"https://api.github.com/repos/azime/navitia/milestones{/number}","notifications_url":"https://api.github.com/repos/azime/navitia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azime/navitia/labels{/name}","releases_url":"https://api.github.com/repos/azime/navitia/releases{/id}","created_at":"2014-04-25T14:34:34Z","updated_at":"2014-06-17T14:45:02Z","pushed_at":"2016-01-15T11:43:35Z","git_url":"git://github.com/azime/navitia.git","ssh_url":"git@github.com:azime/navitia.git","clone_url":"https://github.com/azime/navitia.git","svn_url":"https://github.com/azime/navitia","homepage":"http://www.navitia.io/","size":27644,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"CanalTP:dev","ref":"dev","sha":"785c952f3b80f460be01fa03c8ebb73bb9fc7cda","user":{"login":"CanalTP","id":2743985,"avatar_url":"https://avatars.githubusercontent.com/u/2743985?v=3","gravatar_id":"","url":"https://api.github.com/users/CanalTP","html_url":"https://github.com/CanalTP","followers_url":"https://api.github.com/users/CanalTP/followers","following_url":"https://api.github.com/users/CanalTP/following{/other_user}","gists_url":"https://api.github.com/users/CanalTP/gists{/gist_id}","starred_url":"https://api.github.com/users/CanalTP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CanalTP/subscriptions","organizations_url":"https://api.github.com/users/CanalTP/orgs","repos_url":"https://api.github.com/users/CanalTP/repos","events_url":"https://api.github.com/users/CanalTP/events{/privacy}","received_events_url":"https://api.github.com/users/CanalTP/received_events","type":"Organization","site_admin":false},"repo":{"id":10797333,"name":"navitia","full_name":"CanalTP/navitia","owner":{"login":"CanalTP","id":2743985,"avatar_url":"https://avatars.githubusercontent.com/u/2743985?v=3","gravatar_id":"","url":"https://api.github.com/users/CanalTP","html_url":"https://github.com/CanalTP","followers_url":"https://api.github.com/users/CanalTP/followers","following_url":"https://api.github.com/users/CanalTP/following{/other_user}","gists_url":"https://api.github.com/users/CanalTP/gists{/gist_id}","starred_url":"https://api.github.com/users/CanalTP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CanalTP/subscriptions","organizations_url":"https://api.github.com/users/CanalTP/orgs","repos_url":"https://api.github.com/users/CanalTP/repos","events_url":"https://api.github.com/users/CanalTP/events{/privacy}","received_events_url":"https://api.github.com/users/CanalTP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CanalTP/navitia","description":"The open source software to build responsive stuff with locomotion","fork":false,"url":"https://api.github.com/repos/CanalTP/navitia","forks_url":"https://api.github.com/repos/CanalTP/navitia/forks","keys_url":"https://api.github.com/repos/CanalTP/navitia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CanalTP/navitia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CanalTP/navitia/teams","hooks_url":"https://api.github.com/repos/CanalTP/navitia/hooks","issue_events_url":"https://api.github.com/repos/CanalTP/navitia/issues/events{/number}","events_url":"https://api.github.com/repos/CanalTP/navitia/events","assignees_url":"https://api.github.com/repos/CanalTP/navitia/assignees{/user}","branches_url":"https://api.github.com/repos/CanalTP/navitia/branches{/branch}","tags_url":"https://api.github.com/repos/CanalTP/navitia/tags","blobs_url":"https://api.github.com/repos/CanalTP/navitia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CanalTP/navitia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CanalTP/navitia/git/refs{/sha}","trees_url":"https://api.github.com/repos/CanalTP/navitia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CanalTP/navitia/statuses/{sha}","languages_url":"https://api.github.com/repos/CanalTP/navitia/languages","stargazers_url":"https://api.github.com/repos/CanalTP/navitia/stargazers","contributors_url":"https://api.github.com/repos/CanalTP/navitia/contributors","subscribers_url":"https://api.github.com/repos/CanalTP/navitia/subscribers","subscription_url":"https://api.github.com/repos/CanalTP/navitia/subscription","commits_url":"https://api.github.com/repos/CanalTP/navitia/commits{/sha}","git_commits_url":"https://api.github.com/repos/CanalTP/navitia/git/commits{/sha}","comments_url":"https://api.github.com/repos/CanalTP/navitia/comments{/number}","issue_comment_url":"https://api.github.com/repos/CanalTP/navitia/issues/comments{/number}","contents_url":"https://api.github.com/repos/CanalTP/navitia/contents/{+path}","compare_url":"https://api.github.com/repos/CanalTP/navitia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CanalTP/navitia/merges","archive_url":"https://api.github.com/repos/CanalTP/navitia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CanalTP/navitia/downloads","issues_url":"https://api.github.com/repos/CanalTP/navitia/issues{/number}","pulls_url":"https://api.github.com/repos/CanalTP/navitia/pulls{/number}","milestones_url":"https://api.github.com/repos/CanalTP/navitia/milestones{/number}","notifications_url":"https://api.github.com/repos/CanalTP/navitia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CanalTP/navitia/labels{/name}","releases_url":"https://api.github.com/repos/CanalTP/navitia/releases{/id}","created_at":"2013-06-19T15:34:30Z","updated_at":"2016-01-12T20:53:57Z","pushed_at":"2016-01-15T15:24:17Z","git_url":"git://github.com/CanalTP/navitia.git","ssh_url":"git@github.com:CanalTP/navitia.git","clone_url":"https://github.com/CanalTP/navitia.git","svn_url":"https://github.com/CanalTP/navitia","homepage":"http://www.navitia.io","size":32646,"stargazers_count":142,"watchers_count":142,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":14,"forks":52,"open_issues":14,"watchers":142,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/1367"},"html":{"href":"https://github.com/CanalTP/navitia/pull/1367"},"issue":{"href":"https://api.github.com/repos/CanalTP/navitia/issues/1367"},"comments":{"href":"https://api.github.com/repos/CanalTP/navitia/issues/1367/comments"},"review_comments":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/1367/comments"},"review_comment":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CanalTP/navitia/pulls/1367/commits"},"statuses":{"href":"https://api.github.com/repos/CanalTP/navitia/statuses/9e95e6af6b4cd87fd8bb1e3242f983ccce844fde"}}}}