{"action":"created","comment":{"url":"https://api.github.com/repos/ImageEngine/gaffer/pulls/comments/32108750","id":32108750,"diff_hunk":"@@ -73,6 +74,19 @@ void matchingPaths( const Filter *filter, const ScenePlug *scene, PathMatcher &p\n /// FilteredSceneProcessor::filterPlug() would be passed.\n void matchingPaths( const Gaffer::IntPlug *filterPlug, const ScenePlug *scene, PathMatcher &paths );\n \n+/// Calls a functor on all paths in the scene\n+/// The functor must take ( const ScenePlug*, const ScenePlug::ScenePath& ), and can return false to prune traversal\n+template <class ThreadableFunctor>\n+void parallelTraverse( const ScenePlug *scene, ThreadableFunctor &f, const Gaffer::Context *context = Gaffer::Context::current() );","path":"include/GafferScene/SceneAlgo.h","position":15,"original_position":15,"commit_id":"312f18d370130b266959e33a1ea8ecd893f4e961","original_commit_id":"312f18d370130b266959e33a1ea8ecd893f4e961","user":{"login":"johnhaddon","id":1133871,"avatar_url":"https://avatars.githubusercontent.com/u/1133871?v=3","gravatar_id":"","url":"https://api.github.com/users/johnhaddon","html_url":"https://github.com/johnhaddon","followers_url":"https://api.github.com/users/johnhaddon/followers","following_url":"https://api.github.com/users/johnhaddon/following{/other_user}","gists_url":"https://api.github.com/users/johnhaddon/gists{/gist_id}","starred_url":"https://api.github.com/users/johnhaddon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnhaddon/subscriptions","organizations_url":"https://api.github.com/users/johnhaddon/orgs","repos_url":"https://api.github.com/users/johnhaddon/repos","events_url":"https://api.github.com/users/johnhaddon/events{/privacy}","received_events_url":"https://api.github.com/users/johnhaddon/received_events","type":"User","site_admin":false},"body":"I may have confused the issue in my earlier review comments, but I don't think the context should be an argument to `parallelTraverse()`. Everywhere (almost - there are a couple of places to be fixed) in the API, the context in which an action is performed is implicit, and is specified by making a context current before calling a method.\r\n\r\nWe do sometimes pass a context explicitly in the internals of the implementation of an action, to say \"here is the current context, this should save you the time you'd otherwise take to retrieve it with `Context::current()`\". So I was suggesting that we might want to have the context be an argument to the Functor for that reason. I'm open to discussion on that - it seems to be an awkward middle ground between external and internal code.\r\n","created_at":"2015-06-10T11:37:54Z","updated_at":"2015-06-10T11:37:54Z","html_url":"https://github.com/ImageEngine/gaffer/pull/1342#discussion_r32108750","pull_request_url":"https://api.github.com/repos/ImageEngine/gaffer/pulls/1342","_links":{"self":{"href":"https://api.github.com/repos/ImageEngine/gaffer/pulls/comments/32108750"},"html":{"href":"https://github.com/ImageEngine/gaffer/pull/1342#discussion_r32108750"},"pull_request":{"href":"https://api.github.com/repos/ImageEngine/gaffer/pulls/1342"}}},"pull_request":{"url":"https://api.github.com/repos/ImageEngine/gaffer/pulls/1342","id":37314174,"html_url":"https://github.com/ImageEngine/gaffer/pull/1342","diff_url":"https://github.com/ImageEngine/gaffer/pull/1342.diff","patch_url":"https://github.com/ImageEngine/gaffer/pull/1342.patch","issue_url":"https://api.github.com/repos/ImageEngine/gaffer/issues/1342","number":1342,"state":"open","locked":false,"title":"Added parallelTraverse and filteredParallelTraverse to SceneAlgo.","user":{"login":"danieldresser","id":4043098,"avatar_url":"https://avatars.githubusercontent.com/u/4043098?v=3","gravatar_id":"","url":"https://api.github.com/users/danieldresser","html_url":"https://github.com/danieldresser","followers_url":"https://api.github.com/users/danieldresser/followers","following_url":"https://api.github.com/users/danieldresser/following{/other_user}","gists_url":"https://api.github.com/users/danieldresser/gists{/gist_id}","starred_url":"https://api.github.com/users/danieldresser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieldresser/subscriptions","organizations_url":"https://api.github.com/users/danieldresser/orgs","repos_url":"https://api.github.com/users/danieldresser/repos","events_url":"https://api.github.com/users/danieldresser/events{/privacy}","received_events_url":"https://api.github.com/users/danieldresser/received_events","type":"User","site_admin":false},"body":"Reimplemented GafferScene::matchingPaths and GafferSceneTest::traverseScene using them.\r\n\r\nThis work seems to have gone fairly cleanly.  We should probably wait until I actually implement the other case where I'm planning to use this before we merge, just to make sure it does cover all needed options.\r\n\r\nBut you can go ahead and take a look at whether this looks OK.","created_at":"2015-06-10T00:22:48Z","updated_at":"2015-06-10T11:37:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"147d4e680eaad99bc018d7b9d26e338e0d811d6c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ImageEngine/gaffer/pulls/1342/commits","review_comments_url":"https://api.github.com/repos/ImageEngine/gaffer/pulls/1342/comments","review_comment_url":"https://api.github.com/repos/ImageEngine/gaffer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ImageEngine/gaffer/issues/1342/comments","statuses_url":"https://api.github.com/repos/ImageEngine/gaffer/statuses/312f18d370130b266959e33a1ea8ecd893f4e961","head":{"label":"danieldresser:traverseV2","ref":"traverseV2","sha":"312f18d370130b266959e33a1ea8ecd893f4e961","user":{"login":"danieldresser","id":4043098,"avatar_url":"https://avatars.githubusercontent.com/u/4043098?v=3","gravatar_id":"","url":"https://api.github.com/users/danieldresser","html_url":"https://github.com/danieldresser","followers_url":"https://api.github.com/users/danieldresser/followers","following_url":"https://api.github.com/users/danieldresser/following{/other_user}","gists_url":"https://api.github.com/users/danieldresser/gists{/gist_id}","starred_url":"https://api.github.com/users/danieldresser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieldresser/subscriptions","organizations_url":"https://api.github.com/users/danieldresser/orgs","repos_url":"https://api.github.com/users/danieldresser/repos","events_url":"https://api.github.com/users/danieldresser/events{/privacy}","received_events_url":"https://api.github.com/users/danieldresser/received_events","type":"User","site_admin":false},"repo":{"id":12474128,"name":"gaffer","full_name":"danieldresser/gaffer","owner":{"login":"danieldresser","id":4043098,"avatar_url":"https://avatars.githubusercontent.com/u/4043098?v=3","gravatar_id":"","url":"https://api.github.com/users/danieldresser","html_url":"https://github.com/danieldresser","followers_url":"https://api.github.com/users/danieldresser/followers","following_url":"https://api.github.com/users/danieldresser/following{/other_user}","gists_url":"https://api.github.com/users/danieldresser/gists{/gist_id}","starred_url":"https://api.github.com/users/danieldresser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieldresser/subscriptions","organizations_url":"https://api.github.com/users/danieldresser/orgs","repos_url":"https://api.github.com/users/danieldresser/repos","events_url":"https://api.github.com/users/danieldresser/events{/privacy}","received_events_url":"https://api.github.com/users/danieldresser/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danieldresser/gaffer","description":"Gaffer is an open source application framework designed specifically for creating tools for use in visual effects production.","fork":true,"url":"https://api.github.com/repos/danieldresser/gaffer","forks_url":"https://api.github.com/repos/danieldresser/gaffer/forks","keys_url":"https://api.github.com/repos/danieldresser/gaffer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danieldresser/gaffer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danieldresser/gaffer/teams","hooks_url":"https://api.github.com/repos/danieldresser/gaffer/hooks","issue_events_url":"https://api.github.com/repos/danieldresser/gaffer/issues/events{/number}","events_url":"https://api.github.com/repos/danieldresser/gaffer/events","assignees_url":"https://api.github.com/repos/danieldresser/gaffer/assignees{/user}","branches_url":"https://api.github.com/repos/danieldresser/gaffer/branches{/branch}","tags_url":"https://api.github.com/repos/danieldresser/gaffer/tags","blobs_url":"https://api.github.com/repos/danieldresser/gaffer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danieldresser/gaffer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danieldresser/gaffer/git/refs{/sha}","trees_url":"https://api.github.com/repos/danieldresser/gaffer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danieldresser/gaffer/statuses/{sha}","languages_url":"https://api.github.com/repos/danieldresser/gaffer/languages","stargazers_url":"https://api.github.com/repos/danieldresser/gaffer/stargazers","contributors_url":"https://api.github.com/repos/danieldresser/gaffer/contributors","subscribers_url":"https://api.github.com/repos/danieldresser/gaffer/subscribers","subscription_url":"https://api.github.com/repos/danieldresser/gaffer/subscription","commits_url":"https://api.github.com/repos/danieldresser/gaffer/commits{/sha}","git_commits_url":"https://api.github.com/repos/danieldresser/gaffer/git/commits{/sha}","comments_url":"https://api.github.com/repos/danieldresser/gaffer/comments{/number}","issue_comment_url":"https://api.github.com/repos/danieldresser/gaffer/issues/comments{/number}","contents_url":"https://api.github.com/repos/danieldresser/gaffer/contents/{+path}","compare_url":"https://api.github.com/repos/danieldresser/gaffer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danieldresser/gaffer/merges","archive_url":"https://api.github.com/repos/danieldresser/gaffer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danieldresser/gaffer/downloads","issues_url":"https://api.github.com/repos/danieldresser/gaffer/issues{/number}","pulls_url":"https://api.github.com/repos/danieldresser/gaffer/pulls{/number}","milestones_url":"https://api.github.com/repos/danieldresser/gaffer/milestones{/number}","notifications_url":"https://api.github.com/repos/danieldresser/gaffer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danieldresser/gaffer/labels{/name}","releases_url":"https://api.github.com/repos/danieldresser/gaffer/releases{/id}","created_at":"2013-08-30T00:23:37Z","updated_at":"2013-09-11T17:57:10Z","pushed_at":"2015-06-10T00:17:31Z","git_url":"git://github.com/danieldresser/gaffer.git","ssh_url":"git@github.com:danieldresser/gaffer.git","clone_url":"https://github.com/danieldresser/gaffer.git","svn_url":"https://github.com/danieldresser/gaffer","homepage":"","size":17094,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ImageEngine:master","ref":"master","sha":"65a0e151a18aaffa21471a84017c2d5660f5062a","user":{"login":"ImageEngine","id":3976662,"avatar_url":"https://avatars.githubusercontent.com/u/3976662?v=3","gravatar_id":"","url":"https://api.github.com/users/ImageEngine","html_url":"https://github.com/ImageEngine","followers_url":"https://api.github.com/users/ImageEngine/followers","following_url":"https://api.github.com/users/ImageEngine/following{/other_user}","gists_url":"https://api.github.com/users/ImageEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/ImageEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImageEngine/subscriptions","organizations_url":"https://api.github.com/users/ImageEngine/orgs","repos_url":"https://api.github.com/users/ImageEngine/repos","events_url":"https://api.github.com/users/ImageEngine/events{/privacy}","received_events_url":"https://api.github.com/users/ImageEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":9043124,"name":"gaffer","full_name":"ImageEngine/gaffer","owner":{"login":"ImageEngine","id":3976662,"avatar_url":"https://avatars.githubusercontent.com/u/3976662?v=3","gravatar_id":"","url":"https://api.github.com/users/ImageEngine","html_url":"https://github.com/ImageEngine","followers_url":"https://api.github.com/users/ImageEngine/followers","following_url":"https://api.github.com/users/ImageEngine/following{/other_user}","gists_url":"https://api.github.com/users/ImageEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/ImageEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImageEngine/subscriptions","organizations_url":"https://api.github.com/users/ImageEngine/orgs","repos_url":"https://api.github.com/users/ImageEngine/repos","events_url":"https://api.github.com/users/ImageEngine/events{/privacy}","received_events_url":"https://api.github.com/users/ImageEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ImageEngine/gaffer","description":"Gaffer is an open source application framework designed specifically for creating tools for use in visual effects production.","fork":false,"url":"https://api.github.com/repos/ImageEngine/gaffer","forks_url":"https://api.github.com/repos/ImageEngine/gaffer/forks","keys_url":"https://api.github.com/repos/ImageEngine/gaffer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ImageEngine/gaffer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ImageEngine/gaffer/teams","hooks_url":"https://api.github.com/repos/ImageEngine/gaffer/hooks","issue_events_url":"https://api.github.com/repos/ImageEngine/gaffer/issues/events{/number}","events_url":"https://api.github.com/repos/ImageEngine/gaffer/events","assignees_url":"https://api.github.com/repos/ImageEngine/gaffer/assignees{/user}","branches_url":"https://api.github.com/repos/ImageEngine/gaffer/branches{/branch}","tags_url":"https://api.github.com/repos/ImageEngine/gaffer/tags","blobs_url":"https://api.github.com/repos/ImageEngine/gaffer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ImageEngine/gaffer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ImageEngine/gaffer/git/refs{/sha}","trees_url":"https://api.github.com/repos/ImageEngine/gaffer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ImageEngine/gaffer/statuses/{sha}","languages_url":"https://api.github.com/repos/ImageEngine/gaffer/languages","stargazers_url":"https://api.github.com/repos/ImageEngine/gaffer/stargazers","contributors_url":"https://api.github.com/repos/ImageEngine/gaffer/contributors","subscribers_url":"https://api.github.com/repos/ImageEngine/gaffer/subscribers","subscription_url":"https://api.github.com/repos/ImageEngine/gaffer/subscription","commits_url":"https://api.github.com/repos/ImageEngine/gaffer/commits{/sha}","git_commits_url":"https://api.github.com/repos/ImageEngine/gaffer/git/commits{/sha}","comments_url":"https://api.github.com/repos/ImageEngine/gaffer/comments{/number}","issue_comment_url":"https://api.github.com/repos/ImageEngine/gaffer/issues/comments{/number}","contents_url":"https://api.github.com/repos/ImageEngine/gaffer/contents/{+path}","compare_url":"https://api.github.com/repos/ImageEngine/gaffer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ImageEngine/gaffer/merges","archive_url":"https://api.github.com/repos/ImageEngine/gaffer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ImageEngine/gaffer/downloads","issues_url":"https://api.github.com/repos/ImageEngine/gaffer/issues{/number}","pulls_url":"https://api.github.com/repos/ImageEngine/gaffer/pulls{/number}","milestones_url":"https://api.github.com/repos/ImageEngine/gaffer/milestones{/number}","notifications_url":"https://api.github.com/repos/ImageEngine/gaffer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ImageEngine/gaffer/labels{/name}","releases_url":"https://api.github.com/repos/ImageEngine/gaffer/releases{/id}","created_at":"2013-03-27T00:04:53Z","updated_at":"2015-05-26T18:14:21Z","pushed_at":"2015-06-10T10:40:03Z","git_url":"git://github.com/ImageEngine/gaffer.git","ssh_url":"git@github.com:ImageEngine/gaffer.git","clone_url":"https://github.com/ImageEngine/gaffer.git","svn_url":"https://github.com/ImageEngine/gaffer","homepage":"http://imageengine.github.io/gaffer/","size":117098,"stargazers_count":158,"watchers_count":158,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":54,"mirror_url":null,"open_issues_count":209,"forks":54,"open_issues":209,"watchers":158,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ImageEngine/gaffer/pulls/1342"},"html":{"href":"https://github.com/ImageEngine/gaffer/pull/1342"},"issue":{"href":"https://api.github.com/repos/ImageEngine/gaffer/issues/1342"},"comments":{"href":"https://api.github.com/repos/ImageEngine/gaffer/issues/1342/comments"},"review_comments":{"href":"https://api.github.com/repos/ImageEngine/gaffer/pulls/1342/comments"},"review_comment":{"href":"https://api.github.com/repos/ImageEngine/gaffer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ImageEngine/gaffer/pulls/1342/commits"},"statuses":{"href":"https://api.github.com/repos/ImageEngine/gaffer/statuses/312f18d370130b266959e33a1ea8ecd893f4e961"}}}}