{"action":"created","comment":{"url":"https://api.github.com/repos/BlueBrain/Livre/pulls/comments/57187393","id":57187393,"diff_hunk":"@@ -0,0 +1,190 @@\n+/* Copyright (c) 2011-2016, EPFL/Blue Brain Project\n+ *                     Ahmet Bilgili <ahmet.bilgili@epfl.ch>\n+ *\n+ * This file is part of Livre <https://github.com/BlueBrain/Livre>\n+ *\n+ * This library is free software; you can redistribute it and/or modify it under\n+ * the terms of the GNU Lesser General Public License version 3.0 as published\n+ * by the Free Software Foundation.\n+ *\n+ * This library is distributed in the hope that it will be useful, but WITHOUT\n+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n+ * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more\n+ * details.\n+ *\n+ * You should have received a copy of the GNU Lesser General Public License\n+ * along with this library; if not, write to the Free Software Foundation, Inc.,\n+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n+ */\n+\n+#include <livre/core/pipeline/FutureMap.h>\n+#include <livre/core/pipeline/Future.h>\n+#include <livre/core/pipeline/AsyncData.h>\n+\n+namespace livre\n+{\n+\n+typedef std::multimap< std::string, Future > NameFutureMap;\n+typedef std::pair< std::string, Future > NameFuturePair;\n+\n+struct FutureMapImpl\n+{\n+public:\n+\n+    void throwError( const std::string& name ) const\n+    {\n+        LBTHROW( std::runtime_error( std::string( \"Unknown future name: \")\n+                                                  + name ));\n+    }\n+\n+    bool hasFuture( const std::string& name ) const\n+    {\n+        return _futureMap.count( name ) > 0;\n+    }\n+\n+    Futures getFutures( const std::string& name ) const\n+    {\n+        if( name == ALL_FUTURES )\n+        {\n+            Futures futures;\n+            for( const auto& pair: _futureMap )\n+                futures.push_back( pair.second );\n+            return futures;\n+        }\n+\n+        if( !hasFuture( name ))\n+            throwError( name );\n+\n+        Futures futures;\n+        NameFutureMap::const_iterator it = _futureMap.find( name );\n+\n+        while( it != _futureMap.end( ))","path":"livre/core/pipeline/FutureMap.cpp","position":61,"original_position":61,"commit_id":"7bf5b7217b4c99589a5e38dd742b102aae1797d2","original_commit_id":"7bf5b7217b4c99589a5e38dd742b102aae1797d2","user":{"login":"hernando","id":791427,"avatar_url":"https://avatars.githubusercontent.com/u/791427?v=3","gravatar_id":"","url":"https://api.github.com/users/hernando","html_url":"https://github.com/hernando","followers_url":"https://api.github.com/users/hernando/followers","following_url":"https://api.github.com/users/hernando/following{/other_user}","gists_url":"https://api.github.com/users/hernando/gists{/gist_id}","starred_url":"https://api.github.com/users/hernando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hernando/subscriptions","organizations_url":"https://api.github.com/users/hernando/orgs","repos_url":"https://api.github.com/users/hernando/repos","events_url":"https://api.github.com/users/hernando/events{/privacy}","received_events_url":"https://api.github.com/users/hernando/received_events","type":"User","site_admin":false},"body":"You can also use std::copy instead of the loop.","created_at":"2016-03-23T16:08:03Z","updated_at":"2016-03-23T16:08:03Z","html_url":"https://github.com/BlueBrain/Livre/pull/256#discussion_r57187393","pull_request_url":"https://api.github.com/repos/BlueBrain/Livre/pulls/256","_links":{"self":{"href":"https://api.github.com/repos/BlueBrain/Livre/pulls/comments/57187393"},"html":{"href":"https://github.com/BlueBrain/Livre/pull/256#discussion_r57187393"},"pull_request":{"href":"https://api.github.com/repos/BlueBrain/Livre/pulls/256"}}},"pull_request":{"url":"https://api.github.com/repos/BlueBrain/Livre/pulls/256","id":61273904,"html_url":"https://github.com/BlueBrain/Livre/pull/256","diff_url":"https://github.com/BlueBrain/Livre/pull/256.diff","patch_url":"https://github.com/BlueBrain/Livre/pull/256.patch","issue_url":"https://api.github.com/repos/BlueBrain/Livre/issues/256","number":256,"state":"open","locked":false,"title":"Pipeline (alone - not integrated yet)","user":{"login":"bilgili","id":1157568,"avatar_url":"https://avatars.githubusercontent.com/u/1157568?v=3","gravatar_id":"","url":"https://api.github.com/users/bilgili","html_url":"https://github.com/bilgili","followers_url":"https://api.github.com/users/bilgili/followers","following_url":"https://api.github.com/users/bilgili/following{/other_user}","gists_url":"https://api.github.com/users/bilgili/gists{/gist_id}","starred_url":"https://api.github.com/users/bilgili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bilgili/subscriptions","organizations_url":"https://api.github.com/users/bilgili/orgs","repos_url":"https://api.github.com/users/bilgili/repos","events_url":"https://api.github.com/users/bilgili/events{/privacy}","received_events_url":"https://api.github.com/users/bilgili/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-01T17:01:24Z","updated_at":"2016-03-23T16:08:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d1e9318da9b1a313f8f644bd3bba953d8e8de52","assignee":{"login":"hernando","id":791427,"avatar_url":"https://avatars.githubusercontent.com/u/791427?v=3","gravatar_id":"","url":"https://api.github.com/users/hernando","html_url":"https://github.com/hernando","followers_url":"https://api.github.com/users/hernando/followers","following_url":"https://api.github.com/users/hernando/following{/other_user}","gists_url":"https://api.github.com/users/hernando/gists{/gist_id}","starred_url":"https://api.github.com/users/hernando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hernando/subscriptions","organizations_url":"https://api.github.com/users/hernando/orgs","repos_url":"https://api.github.com/users/hernando/repos","events_url":"https://api.github.com/users/hernando/events{/privacy}","received_events_url":"https://api.github.com/users/hernando/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/BlueBrain/Livre/pulls/256/commits","review_comments_url":"https://api.github.com/repos/BlueBrain/Livre/pulls/256/comments","review_comment_url":"https://api.github.com/repos/BlueBrain/Livre/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BlueBrain/Livre/issues/256/comments","statuses_url":"https://api.github.com/repos/BlueBrain/Livre/statuses/7bf5b7217b4c99589a5e38dd742b102aae1797d2","head":{"label":"bilgili:pipeline","ref":"pipeline","sha":"7bf5b7217b4c99589a5e38dd742b102aae1797d2","user":{"login":"bilgili","id":1157568,"avatar_url":"https://avatars.githubusercontent.com/u/1157568?v=3","gravatar_id":"","url":"https://api.github.com/users/bilgili","html_url":"https://github.com/bilgili","followers_url":"https://api.github.com/users/bilgili/followers","following_url":"https://api.github.com/users/bilgili/following{/other_user}","gists_url":"https://api.github.com/users/bilgili/gists{/gist_id}","starred_url":"https://api.github.com/users/bilgili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bilgili/subscriptions","organizations_url":"https://api.github.com/users/bilgili/orgs","repos_url":"https://api.github.com/users/bilgili/repos","events_url":"https://api.github.com/users/bilgili/events{/privacy}","received_events_url":"https://api.github.com/users/bilgili/received_events","type":"User","site_admin":false},"repo":{"id":34505794,"name":"Livre","full_name":"bilgili/Livre","owner":{"login":"bilgili","id":1157568,"avatar_url":"https://avatars.githubusercontent.com/u/1157568?v=3","gravatar_id":"","url":"https://api.github.com/users/bilgili","html_url":"https://github.com/bilgili","followers_url":"https://api.github.com/users/bilgili/followers","following_url":"https://api.github.com/users/bilgili/following{/other_user}","gists_url":"https://api.github.com/users/bilgili/gists{/gist_id}","starred_url":"https://api.github.com/users/bilgili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bilgili/subscriptions","organizations_url":"https://api.github.com/users/bilgili/orgs","repos_url":"https://api.github.com/users/bilgili/repos","events_url":"https://api.github.com/users/bilgili/events{/privacy}","received_events_url":"https://api.github.com/users/bilgili/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bilgili/Livre","description":"Largescale Interactive Volume Rendering Engine","fork":true,"url":"https://api.github.com/repos/bilgili/Livre","forks_url":"https://api.github.com/repos/bilgili/Livre/forks","keys_url":"https://api.github.com/repos/bilgili/Livre/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bilgili/Livre/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bilgili/Livre/teams","hooks_url":"https://api.github.com/repos/bilgili/Livre/hooks","issue_events_url":"https://api.github.com/repos/bilgili/Livre/issues/events{/number}","events_url":"https://api.github.com/repos/bilgili/Livre/events","assignees_url":"https://api.github.com/repos/bilgili/Livre/assignees{/user}","branches_url":"https://api.github.com/repos/bilgili/Livre/branches{/branch}","tags_url":"https://api.github.com/repos/bilgili/Livre/tags","blobs_url":"https://api.github.com/repos/bilgili/Livre/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bilgili/Livre/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bilgili/Livre/git/refs{/sha}","trees_url":"https://api.github.com/repos/bilgili/Livre/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bilgili/Livre/statuses/{sha}","languages_url":"https://api.github.com/repos/bilgili/Livre/languages","stargazers_url":"https://api.github.com/repos/bilgili/Livre/stargazers","contributors_url":"https://api.github.com/repos/bilgili/Livre/contributors","subscribers_url":"https://api.github.com/repos/bilgili/Livre/subscribers","subscription_url":"https://api.github.com/repos/bilgili/Livre/subscription","commits_url":"https://api.github.com/repos/bilgili/Livre/commits{/sha}","git_commits_url":"https://api.github.com/repos/bilgili/Livre/git/commits{/sha}","comments_url":"https://api.github.com/repos/bilgili/Livre/comments{/number}","issue_comment_url":"https://api.github.com/repos/bilgili/Livre/issues/comments{/number}","contents_url":"https://api.github.com/repos/bilgili/Livre/contents/{+path}","compare_url":"https://api.github.com/repos/bilgili/Livre/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bilgili/Livre/merges","archive_url":"https://api.github.com/repos/bilgili/Livre/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bilgili/Livre/downloads","issues_url":"https://api.github.com/repos/bilgili/Livre/issues{/number}","pulls_url":"https://api.github.com/repos/bilgili/Livre/pulls{/number}","milestones_url":"https://api.github.com/repos/bilgili/Livre/milestones{/number}","notifications_url":"https://api.github.com/repos/bilgili/Livre/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bilgili/Livre/labels{/name}","releases_url":"https://api.github.com/repos/bilgili/Livre/releases{/id}","deployments_url":"https://api.github.com/repos/bilgili/Livre/deployments","created_at":"2015-04-24T08:00:16Z","updated_at":"2016-03-10T12:07:49Z","pushed_at":"2016-03-22T14:05:15Z","git_url":"git://github.com/bilgili/Livre.git","ssh_url":"git@github.com:bilgili/Livre.git","clone_url":"https://github.com/bilgili/Livre.git","svn_url":"https://github.com/bilgili/Livre","homepage":"https://bluebrain.github.io","size":8196,"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":"master"}},"base":{"label":"BlueBrain:master","ref":"master","sha":"7b6cfe1f9c4ec46f90f2b8474556f3f3d47c9fc4","user":{"login":"BlueBrain","id":1479142,"avatar_url":"https://avatars.githubusercontent.com/u/1479142?v=3","gravatar_id":"","url":"https://api.github.com/users/BlueBrain","html_url":"https://github.com/BlueBrain","followers_url":"https://api.github.com/users/BlueBrain/followers","following_url":"https://api.github.com/users/BlueBrain/following{/other_user}","gists_url":"https://api.github.com/users/BlueBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueBrain/subscriptions","organizations_url":"https://api.github.com/users/BlueBrain/orgs","repos_url":"https://api.github.com/users/BlueBrain/repos","events_url":"https://api.github.com/users/BlueBrain/events{/privacy}","received_events_url":"https://api.github.com/users/BlueBrain/received_events","type":"Organization","site_admin":false},"repo":{"id":10625435,"name":"Livre","full_name":"BlueBrain/Livre","owner":{"login":"BlueBrain","id":1479142,"avatar_url":"https://avatars.githubusercontent.com/u/1479142?v=3","gravatar_id":"","url":"https://api.github.com/users/BlueBrain","html_url":"https://github.com/BlueBrain","followers_url":"https://api.github.com/users/BlueBrain/followers","following_url":"https://api.github.com/users/BlueBrain/following{/other_user}","gists_url":"https://api.github.com/users/BlueBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueBrain/subscriptions","organizations_url":"https://api.github.com/users/BlueBrain/orgs","repos_url":"https://api.github.com/users/BlueBrain/repos","events_url":"https://api.github.com/users/BlueBrain/events{/privacy}","received_events_url":"https://api.github.com/users/BlueBrain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BlueBrain/Livre","description":"Large-scale Interactive Volume Rendering Engine","fork":false,"url":"https://api.github.com/repos/BlueBrain/Livre","forks_url":"https://api.github.com/repos/BlueBrain/Livre/forks","keys_url":"https://api.github.com/repos/BlueBrain/Livre/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BlueBrain/Livre/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BlueBrain/Livre/teams","hooks_url":"https://api.github.com/repos/BlueBrain/Livre/hooks","issue_events_url":"https://api.github.com/repos/BlueBrain/Livre/issues/events{/number}","events_url":"https://api.github.com/repos/BlueBrain/Livre/events","assignees_url":"https://api.github.com/repos/BlueBrain/Livre/assignees{/user}","branches_url":"https://api.github.com/repos/BlueBrain/Livre/branches{/branch}","tags_url":"https://api.github.com/repos/BlueBrain/Livre/tags","blobs_url":"https://api.github.com/repos/BlueBrain/Livre/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BlueBrain/Livre/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BlueBrain/Livre/git/refs{/sha}","trees_url":"https://api.github.com/repos/BlueBrain/Livre/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BlueBrain/Livre/statuses/{sha}","languages_url":"https://api.github.com/repos/BlueBrain/Livre/languages","stargazers_url":"https://api.github.com/repos/BlueBrain/Livre/stargazers","contributors_url":"https://api.github.com/repos/BlueBrain/Livre/contributors","subscribers_url":"https://api.github.com/repos/BlueBrain/Livre/subscribers","subscription_url":"https://api.github.com/repos/BlueBrain/Livre/subscription","commits_url":"https://api.github.com/repos/BlueBrain/Livre/commits{/sha}","git_commits_url":"https://api.github.com/repos/BlueBrain/Livre/git/commits{/sha}","comments_url":"https://api.github.com/repos/BlueBrain/Livre/comments{/number}","issue_comment_url":"https://api.github.com/repos/BlueBrain/Livre/issues/comments{/number}","contents_url":"https://api.github.com/repos/BlueBrain/Livre/contents/{+path}","compare_url":"https://api.github.com/repos/BlueBrain/Livre/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BlueBrain/Livre/merges","archive_url":"https://api.github.com/repos/BlueBrain/Livre/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BlueBrain/Livre/downloads","issues_url":"https://api.github.com/repos/BlueBrain/Livre/issues{/number}","pulls_url":"https://api.github.com/repos/BlueBrain/Livre/pulls{/number}","milestones_url":"https://api.github.com/repos/BlueBrain/Livre/milestones{/number}","notifications_url":"https://api.github.com/repos/BlueBrain/Livre/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BlueBrain/Livre/labels{/name}","releases_url":"https://api.github.com/repos/BlueBrain/Livre/releases{/id}","deployments_url":"https://api.github.com/repos/BlueBrain/Livre/deployments","created_at":"2013-06-11T16:13:56Z","updated_at":"2016-02-04T10:44:08Z","pushed_at":"2016-03-23T13:35:55Z","git_url":"git://github.com/BlueBrain/Livre.git","ssh_url":"git@github.com:BlueBrain/Livre.git","clone_url":"https://github.com/BlueBrain/Livre.git","svn_url":"https://github.com/BlueBrain/Livre","homepage":"https://bluebrain.github.io","size":8232,"stargazers_count":8,"watchers_count":8,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":28,"forks":14,"open_issues":28,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BlueBrain/Livre/pulls/256"},"html":{"href":"https://github.com/BlueBrain/Livre/pull/256"},"issue":{"href":"https://api.github.com/repos/BlueBrain/Livre/issues/256"},"comments":{"href":"https://api.github.com/repos/BlueBrain/Livre/issues/256/comments"},"review_comments":{"href":"https://api.github.com/repos/BlueBrain/Livre/pulls/256/comments"},"review_comment":{"href":"https://api.github.com/repos/BlueBrain/Livre/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BlueBrain/Livre/pulls/256/commits"},"statuses":{"href":"https://api.github.com/repos/BlueBrain/Livre/statuses/7bf5b7217b4c99589a5e38dd742b102aae1797d2"}}}}