{"action":"created","comment":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/comments/225363124","pull_request_review_id":164948991,"id":225363124,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTM2MzEyNA==","diff_hunk":"@@ -0,0 +1,98 @@\n+#ifndef _VALUE_FACTORY_H_\n+#define _VALUE_FACTORY_H_\n+\n+#include \"ProtoAtom.h\"\n+#include <opencog/atoms/base/Handle.h>\n+\n+#include <exception>\n+#include <map>\n+#include <typeinfo>\n+#include <typeindex>\n+#include <vector>\n+\n+namespace opencog\n+{\n+using CreateProto = ProtoAtomPtr (*) (...);\n+\n+struct FuncRegister\n+{\n+    CreateProto func;\n+    std::vector<std::type_index> args;\n+};\n+\n+class ValueFactory\n+{\n+private:\n+\n+#define THROW_ERROR \\\n+    (throw std::invalid_argument(\"There was no function found for the given type.\"))\n+","path":"opencog/atoms/proto/ValueFactory.h","position":29,"original_position":29,"commit_id":"a98814f4ae8c6d437402ad537c396b4dc617de0c","original_commit_id":"a98814f4ae8c6d437402ad537c396b4dc617de0c","user":{"login":"linas","id":94368,"node_id":"MDQ6VXNlcjk0MzY4","avatar_url":"https://avatars2.githubusercontent.com/u/94368?v=4","gravatar_id":"","url":"https://api.github.com/users/linas","html_url":"https://github.com/linas","followers_url":"https://api.github.com/users/linas/followers","following_url":"https://api.github.com/users/linas/following{/other_user}","gists_url":"https://api.github.com/users/linas/gists{/gist_id}","starred_url":"https://api.github.com/users/linas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linas/subscriptions","organizations_url":"https://api.github.com/users/linas/orgs","repos_url":"https://api.github.com/users/linas/repos","events_url":"https://api.github.com/users/linas/events{/privacy}","received_events_url":"https://api.github.com/users/linas/received_events","type":"User","site_admin":false},"body":"For historical reasons, we should continue to use the exceptions defined in cogutils.  They have a standard framework for printing, error logging, and the scheme code knows how to catch and rethrow them to the user.","created_at":"2018-10-16T00:50:28Z","updated_at":"2018-10-16T00:50:28Z","html_url":"https://github.com/opencog/atomspace/pull/1883#discussion_r225363124","pull_request_url":"https://api.github.com/repos/opencog/atomspace/pulls/1883","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments/225363124"},"html":{"href":"https://github.com/opencog/atomspace/pull/1883#discussion_r225363124"},"pull_request":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/1883"}}},"pull_request":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/1883","id":223083357,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzMDgzMzU3","html_url":"https://github.com/opencog/atomspace/pull/1883","diff_url":"https://github.com/opencog/atomspace/pull/1883.diff","patch_url":"https://github.com/opencog/atomspace/pull/1883.patch","issue_url":"https://api.github.com/repos/opencog/atomspace/issues/1883","number":1883,"state":"open","locked":false,"title":"Create a Value factory ","user":{"login":"linas","id":94368,"node_id":"MDQ6VXNlcjk0MzY4","avatar_url":"https://avatars2.githubusercontent.com/u/94368?v=4","gravatar_id":"","url":"https://api.github.com/users/linas","html_url":"https://github.com/linas","followers_url":"https://api.github.com/users/linas/followers","following_url":"https://api.github.com/users/linas/following{/other_user}","gists_url":"https://api.github.com/users/linas/gists{/gist_id}","starred_url":"https://api.github.com/users/linas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linas/subscriptions","organizations_url":"https://api.github.com/users/linas/orgs","repos_url":"https://api.github.com/users/linas/repos","events_url":"https://api.github.com/users/linas/events{/privacy}","received_events_url":"https://api.github.com/users/linas/received_events","type":"User","site_admin":false},"body":"Having explicit factories for values allows other other modules, outside of the atomspace (such as the octomap) to define values, and have them be treated in an automatic way.\r\n\r\nPer private conversations with Misgana, this needs about 5-6 minor fixes/tweaks before being merged.","created_at":"2018-10-16T00:44:23Z","updated_at":"2018-10-16T00:50:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d3991a98d34183f6d7312b85b452eb50fbc2547","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/opencog/atomspace/pulls/1883/commits","review_comments_url":"https://api.github.com/repos/opencog/atomspace/pulls/1883/comments","review_comment_url":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencog/atomspace/issues/1883/comments","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/a98814f4ae8c6d437402ad537c396b4dc617de0c","head":{"label":"misgeatgit:value-refactor","ref":"value-refactor","sha":"a98814f4ae8c6d437402ad537c396b4dc617de0c","user":{"login":"misgeatgit","id":2872565,"node_id":"MDQ6VXNlcjI4NzI1NjU=","avatar_url":"https://avatars0.githubusercontent.com/u/2872565?v=4","gravatar_id":"","url":"https://api.github.com/users/misgeatgit","html_url":"https://github.com/misgeatgit","followers_url":"https://api.github.com/users/misgeatgit/followers","following_url":"https://api.github.com/users/misgeatgit/following{/other_user}","gists_url":"https://api.github.com/users/misgeatgit/gists{/gist_id}","starred_url":"https://api.github.com/users/misgeatgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/misgeatgit/subscriptions","organizations_url":"https://api.github.com/users/misgeatgit/orgs","repos_url":"https://api.github.com/users/misgeatgit/repos","events_url":"https://api.github.com/users/misgeatgit/events{/privacy}","received_events_url":"https://api.github.com/users/misgeatgit/received_events","type":"User","site_admin":false},"repo":{"id":35009837,"node_id":"MDEwOlJlcG9zaXRvcnkzNTAwOTgzNw==","name":"atomspace","full_name":"misgeatgit/atomspace","private":false,"owner":{"login":"misgeatgit","id":2872565,"node_id":"MDQ6VXNlcjI4NzI1NjU=","avatar_url":"https://avatars0.githubusercontent.com/u/2872565?v=4","gravatar_id":"","url":"https://api.github.com/users/misgeatgit","html_url":"https://github.com/misgeatgit","followers_url":"https://api.github.com/users/misgeatgit/followers","following_url":"https://api.github.com/users/misgeatgit/following{/other_user}","gists_url":"https://api.github.com/users/misgeatgit/gists{/gist_id}","starred_url":"https://api.github.com/users/misgeatgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/misgeatgit/subscriptions","organizations_url":"https://api.github.com/users/misgeatgit/orgs","repos_url":"https://api.github.com/users/misgeatgit/repos","events_url":"https://api.github.com/users/misgeatgit/events{/privacy}","received_events_url":"https://api.github.com/users/misgeatgit/received_events","type":"User","site_admin":false},"html_url":"https://github.com/misgeatgit/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":true,"url":"https://api.github.com/repos/misgeatgit/atomspace","forks_url":"https://api.github.com/repos/misgeatgit/atomspace/forks","keys_url":"https://api.github.com/repos/misgeatgit/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/misgeatgit/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/misgeatgit/atomspace/teams","hooks_url":"https://api.github.com/repos/misgeatgit/atomspace/hooks","issue_events_url":"https://api.github.com/repos/misgeatgit/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/misgeatgit/atomspace/events","assignees_url":"https://api.github.com/repos/misgeatgit/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/misgeatgit/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/misgeatgit/atomspace/tags","blobs_url":"https://api.github.com/repos/misgeatgit/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/misgeatgit/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/misgeatgit/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/misgeatgit/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/misgeatgit/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/misgeatgit/atomspace/languages","stargazers_url":"https://api.github.com/repos/misgeatgit/atomspace/stargazers","contributors_url":"https://api.github.com/repos/misgeatgit/atomspace/contributors","subscribers_url":"https://api.github.com/repos/misgeatgit/atomspace/subscribers","subscription_url":"https://api.github.com/repos/misgeatgit/atomspace/subscription","commits_url":"https://api.github.com/repos/misgeatgit/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/misgeatgit/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/misgeatgit/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/misgeatgit/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/misgeatgit/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/misgeatgit/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/misgeatgit/atomspace/merges","archive_url":"https://api.github.com/repos/misgeatgit/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/misgeatgit/atomspace/downloads","issues_url":"https://api.github.com/repos/misgeatgit/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/misgeatgit/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/misgeatgit/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/misgeatgit/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/misgeatgit/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/misgeatgit/atomspace/releases{/id}","deployments_url":"https://api.github.com/repos/misgeatgit/atomspace/deployments","created_at":"2015-05-04T02:26:26Z","updated_at":"2018-04-24T07:53:23Z","pushed_at":"2018-10-12T08:13:52Z","git_url":"git://github.com/misgeatgit/atomspace.git","ssh_url":"git@github.com:misgeatgit/atomspace.git","clone_url":"https://github.com/misgeatgit/atomspace.git","svn_url":"https://github.com/misgeatgit/atomspace","homepage":"","size":151970,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"opencog:master","ref":"master","sha":"b237583f1b7f4d3f81f49382a342dadd7f097775","user":{"login":"opencog","id":2109913,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDk5MTM=","avatar_url":"https://avatars1.githubusercontent.com/u/2109913?v=4","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"repo":{"id":34678084,"node_id":"MDEwOlJlcG9zaXRvcnkzNDY3ODA4NA==","name":"atomspace","full_name":"opencog/atomspace","private":false,"owner":{"login":"opencog","id":2109913,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDk5MTM=","avatar_url":"https://avatars1.githubusercontent.com/u/2109913?v=4","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/opencog/atomspace","description":"The OpenCog hypergraph database, query system and rule engine","fork":false,"url":"https://api.github.com/repos/opencog/atomspace","forks_url":"https://api.github.com/repos/opencog/atomspace/forks","keys_url":"https://api.github.com/repos/opencog/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencog/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencog/atomspace/teams","hooks_url":"https://api.github.com/repos/opencog/atomspace/hooks","issue_events_url":"https://api.github.com/repos/opencog/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/opencog/atomspace/events","assignees_url":"https://api.github.com/repos/opencog/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/opencog/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/opencog/atomspace/tags","blobs_url":"https://api.github.com/repos/opencog/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencog/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencog/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencog/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/opencog/atomspace/languages","stargazers_url":"https://api.github.com/repos/opencog/atomspace/stargazers","contributors_url":"https://api.github.com/repos/opencog/atomspace/contributors","subscribers_url":"https://api.github.com/repos/opencog/atomspace/subscribers","subscription_url":"https://api.github.com/repos/opencog/atomspace/subscription","commits_url":"https://api.github.com/repos/opencog/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencog/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencog/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencog/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencog/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/opencog/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencog/atomspace/merges","archive_url":"https://api.github.com/repos/opencog/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencog/atomspace/downloads","issues_url":"https://api.github.com/repos/opencog/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/opencog/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/opencog/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/opencog/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencog/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/opencog/atomspace/releases{/id}","deployments_url":"https://api.github.com/repos/opencog/atomspace/deployments","created_at":"2015-04-27T16:32:57Z","updated_at":"2018-10-11T13:30:35Z","pushed_at":"2018-10-16T00:44:24Z","git_url":"git://github.com/opencog/atomspace.git","ssh_url":"git@github.com:opencog/atomspace.git","clone_url":"https://github.com/opencog/atomspace.git","svn_url":"https://github.com/opencog/atomspace","homepage":"","size":151951,"stargazers_count":210,"watchers_count":210,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":134,"mirror_url":null,"archived":false,"open_issues_count":76,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":134,"open_issues":76,"watchers":210,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/1883"},"html":{"href":"https://github.com/opencog/atomspace/pull/1883"},"issue":{"href":"https://api.github.com/repos/opencog/atomspace/issues/1883"},"comments":{"href":"https://api.github.com/repos/opencog/atomspace/issues/1883/comments"},"review_comments":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/1883/comments"},"review_comment":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/1883/commits"},"statuses":{"href":"https://api.github.com/repos/opencog/atomspace/statuses/a98814f4ae8c6d437402ad537c396b4dc617de0c"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"linas"}}