{"action":"created","comment":{"url":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/comments/200617326","pull_request_review_id":134968978,"id":200617326,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDYxNzMyNg==","diff_hunk":"@@ -0,0 +1,45 @@\n+#ifndef THETA_CLOUD_H\n+#define THETA_CLOUD_H\n+\n+#include <map>\n+#include <list>\n+#include <memory>\n+#include <functional>\n+#include \"SensorData.h\"\n+#include \"DeviceHandlerToken.h\"\n+\n+class ThetaCloud\n+{\n+public:\n+    using Emit = std::function<void(const SensorData &)>;\n+    using DeviceReadHandler = std::function<void(const Emit &)>;\n+    using DeviceWriteHandler = std::function<void(const SensorData &, const Emit &)>;\n+    ThetaCloud() :\n+        dataCallback([](const SensorData &){\n+    }),\n+        initialized(false)\n+    {\n+    }\n+    ~ThetaCloud()\n+    {\n+    }\n+\n+    void init();\n+    void whenDataAvailable(const Emit &dataCallback);\n+    DeviceHandlerTokenPtr addReadHandler(const DeviceReadHandler &handler);\n+    DeviceHandlerTokenPtr addWriteHandler(const std::string &topic,\n+                                          const DeviceWriteHandler &handler);\n+    void write(const SensorData &data) const;\n+    void emit(const SensorData &data) const;\n+    void tick();\n+private:\n+\n+    Emit dataCallback;\n+    bool initialized;\n+    std::list<DeviceReadHandler> deviceReadHandlers;","path":"ThetaCloud.h","position":null,"original_position":39,"commit_id":"a30892349152e91f51257ac84d1922cd3eeecc2d","original_commit_id":"074a352860182ec647043a932dd6d2a5c32d0dfe","user":{"login":"michalrud","id":25756,"node_id":"MDQ6VXNlcjI1NzU2","avatar_url":"https://avatars1.githubusercontent.com/u/25756?v=4","gravatar_id":"","url":"https://api.github.com/users/michalrud","html_url":"https://github.com/michalrud","followers_url":"https://api.github.com/users/michalrud/followers","following_url":"https://api.github.com/users/michalrud/following{/other_user}","gists_url":"https://api.github.com/users/michalrud/gists{/gist_id}","starred_url":"https://api.github.com/users/michalrud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalrud/subscriptions","organizations_url":"https://api.github.com/users/michalrud/orgs","repos_url":"https://api.github.com/users/michalrud/repos","events_url":"https://api.github.com/users/michalrud/events{/privacy}","received_events_url":"https://api.github.com/users/michalrud/received_events","type":"User","site_admin":false},"body":":heavy_check_mark: ","created_at":"2018-07-06T10:45:16Z","updated_at":"2018-07-06T10:45:16Z","html_url":"https://github.com/michalrud/ThetaCloud/pull/1#discussion_r200617326","pull_request_url":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/comments/200617326"},"html":{"href":"https://github.com/michalrud/ThetaCloud/pull/1#discussion_r200617326"},"pull_request":{"href":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/1"}},"in_reply_to_id":200584048},"pull_request":{"url":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/1","id":199671927,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NjcxOTI3","html_url":"https://github.com/michalrud/ThetaCloud/pull/1","diff_url":"https://github.com/michalrud/ThetaCloud/pull/1.diff","patch_url":"https://github.com/michalrud/ThetaCloud/pull/1.patch","issue_url":"https://api.github.com/repos/michalrud/ThetaCloud/issues/1","number":1,"state":"open","locked":false,"title":"Everything","user":{"login":"michalrud","id":25756,"node_id":"MDQ6VXNlcjI1NzU2","avatar_url":"https://avatars1.githubusercontent.com/u/25756?v=4","gravatar_id":"","url":"https://api.github.com/users/michalrud","html_url":"https://github.com/michalrud","followers_url":"https://api.github.com/users/michalrud/followers","following_url":"https://api.github.com/users/michalrud/following{/other_user}","gists_url":"https://api.github.com/users/michalrud/gists{/gist_id}","starred_url":"https://api.github.com/users/michalrud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalrud/subscriptions","organizations_url":"https://api.github.com/users/michalrud/orgs","repos_url":"https://api.github.com/users/michalrud/repos","events_url":"https://api.github.com/users/michalrud/events{/privacy}","received_events_url":"https://api.github.com/users/michalrud/received_events","type":"User","site_admin":false},"body":"Review of all the code written.","created_at":"2018-07-06T07:56:46Z","updated_at":"2018-07-06T10:45:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e5b8528e1809bfebdcc54b963200999e17abb5b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/1/commits","review_comments_url":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/1/comments","review_comment_url":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/comments{/number}","comments_url":"https://api.github.com/repos/michalrud/ThetaCloud/issues/1/comments","statuses_url":"https://api.github.com/repos/michalrud/ThetaCloud/statuses/a30892349152e91f51257ac84d1922cd3eeecc2d","head":{"label":"michalrud:everything","ref":"everything","sha":"a30892349152e91f51257ac84d1922cd3eeecc2d","user":{"login":"michalrud","id":25756,"node_id":"MDQ6VXNlcjI1NzU2","avatar_url":"https://avatars1.githubusercontent.com/u/25756?v=4","gravatar_id":"","url":"https://api.github.com/users/michalrud","html_url":"https://github.com/michalrud","followers_url":"https://api.github.com/users/michalrud/followers","following_url":"https://api.github.com/users/michalrud/following{/other_user}","gists_url":"https://api.github.com/users/michalrud/gists{/gist_id}","starred_url":"https://api.github.com/users/michalrud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalrud/subscriptions","organizations_url":"https://api.github.com/users/michalrud/orgs","repos_url":"https://api.github.com/users/michalrud/repos","events_url":"https://api.github.com/users/michalrud/events{/privacy}","received_events_url":"https://api.github.com/users/michalrud/received_events","type":"User","site_admin":false},"repo":{"id":139951799,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk5NTE3OTk=","name":"ThetaCloud","full_name":"michalrud/ThetaCloud","owner":{"login":"michalrud","id":25756,"node_id":"MDQ6VXNlcjI1NzU2","avatar_url":"https://avatars1.githubusercontent.com/u/25756?v=4","gravatar_id":"","url":"https://api.github.com/users/michalrud","html_url":"https://github.com/michalrud","followers_url":"https://api.github.com/users/michalrud/followers","following_url":"https://api.github.com/users/michalrud/following{/other_user}","gists_url":"https://api.github.com/users/michalrud/gists{/gist_id}","starred_url":"https://api.github.com/users/michalrud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalrud/subscriptions","organizations_url":"https://api.github.com/users/michalrud/orgs","repos_url":"https://api.github.com/users/michalrud/repos","events_url":"https://api.github.com/users/michalrud/events{/privacy}","received_events_url":"https://api.github.com/users/michalrud/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michalrud/ThetaCloud","description":null,"fork":false,"url":"https://api.github.com/repos/michalrud/ThetaCloud","forks_url":"https://api.github.com/repos/michalrud/ThetaCloud/forks","keys_url":"https://api.github.com/repos/michalrud/ThetaCloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michalrud/ThetaCloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michalrud/ThetaCloud/teams","hooks_url":"https://api.github.com/repos/michalrud/ThetaCloud/hooks","issue_events_url":"https://api.github.com/repos/michalrud/ThetaCloud/issues/events{/number}","events_url":"https://api.github.com/repos/michalrud/ThetaCloud/events","assignees_url":"https://api.github.com/repos/michalrud/ThetaCloud/assignees{/user}","branches_url":"https://api.github.com/repos/michalrud/ThetaCloud/branches{/branch}","tags_url":"https://api.github.com/repos/michalrud/ThetaCloud/tags","blobs_url":"https://api.github.com/repos/michalrud/ThetaCloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michalrud/ThetaCloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michalrud/ThetaCloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/michalrud/ThetaCloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michalrud/ThetaCloud/statuses/{sha}","languages_url":"https://api.github.com/repos/michalrud/ThetaCloud/languages","stargazers_url":"https://api.github.com/repos/michalrud/ThetaCloud/stargazers","contributors_url":"https://api.github.com/repos/michalrud/ThetaCloud/contributors","subscribers_url":"https://api.github.com/repos/michalrud/ThetaCloud/subscribers","subscription_url":"https://api.github.com/repos/michalrud/ThetaCloud/subscription","commits_url":"https://api.github.com/repos/michalrud/ThetaCloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/michalrud/ThetaCloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/michalrud/ThetaCloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/michalrud/ThetaCloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/michalrud/ThetaCloud/contents/{+path}","compare_url":"https://api.github.com/repos/michalrud/ThetaCloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michalrud/ThetaCloud/merges","archive_url":"https://api.github.com/repos/michalrud/ThetaCloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michalrud/ThetaCloud/downloads","issues_url":"https://api.github.com/repos/michalrud/ThetaCloud/issues{/number}","pulls_url":"https://api.github.com/repos/michalrud/ThetaCloud/pulls{/number}","milestones_url":"https://api.github.com/repos/michalrud/ThetaCloud/milestones{/number}","notifications_url":"https://api.github.com/repos/michalrud/ThetaCloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michalrud/ThetaCloud/labels{/name}","releases_url":"https://api.github.com/repos/michalrud/ThetaCloud/releases{/id}","deployments_url":"https://api.github.com/repos/michalrud/ThetaCloud/deployments","created_at":"2018-07-06T07:52:37Z","updated_at":"2018-07-06T09:54:48Z","pushed_at":"2018-07-06T10:44:35Z","git_url":"git://github.com/michalrud/ThetaCloud.git","ssh_url":"git@github.com:michalrud/ThetaCloud.git","clone_url":"https://github.com/michalrud/ThetaCloud.git","svn_url":"https://github.com/michalrud/ThetaCloud","homepage":"https://thetacloud.readthedocs.io/en/latest/","size":140,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"michalrud:master","ref":"master","sha":"bee2352eede325c1378ea4d48f7d3b4ae1e2e39b","user":{"login":"michalrud","id":25756,"node_id":"MDQ6VXNlcjI1NzU2","avatar_url":"https://avatars1.githubusercontent.com/u/25756?v=4","gravatar_id":"","url":"https://api.github.com/users/michalrud","html_url":"https://github.com/michalrud","followers_url":"https://api.github.com/users/michalrud/followers","following_url":"https://api.github.com/users/michalrud/following{/other_user}","gists_url":"https://api.github.com/users/michalrud/gists{/gist_id}","starred_url":"https://api.github.com/users/michalrud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalrud/subscriptions","organizations_url":"https://api.github.com/users/michalrud/orgs","repos_url":"https://api.github.com/users/michalrud/repos","events_url":"https://api.github.com/users/michalrud/events{/privacy}","received_events_url":"https://api.github.com/users/michalrud/received_events","type":"User","site_admin":false},"repo":{"id":139951799,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk5NTE3OTk=","name":"ThetaCloud","full_name":"michalrud/ThetaCloud","owner":{"login":"michalrud","id":25756,"node_id":"MDQ6VXNlcjI1NzU2","avatar_url":"https://avatars1.githubusercontent.com/u/25756?v=4","gravatar_id":"","url":"https://api.github.com/users/michalrud","html_url":"https://github.com/michalrud","followers_url":"https://api.github.com/users/michalrud/followers","following_url":"https://api.github.com/users/michalrud/following{/other_user}","gists_url":"https://api.github.com/users/michalrud/gists{/gist_id}","starred_url":"https://api.github.com/users/michalrud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalrud/subscriptions","organizations_url":"https://api.github.com/users/michalrud/orgs","repos_url":"https://api.github.com/users/michalrud/repos","events_url":"https://api.github.com/users/michalrud/events{/privacy}","received_events_url":"https://api.github.com/users/michalrud/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michalrud/ThetaCloud","description":null,"fork":false,"url":"https://api.github.com/repos/michalrud/ThetaCloud","forks_url":"https://api.github.com/repos/michalrud/ThetaCloud/forks","keys_url":"https://api.github.com/repos/michalrud/ThetaCloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michalrud/ThetaCloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michalrud/ThetaCloud/teams","hooks_url":"https://api.github.com/repos/michalrud/ThetaCloud/hooks","issue_events_url":"https://api.github.com/repos/michalrud/ThetaCloud/issues/events{/number}","events_url":"https://api.github.com/repos/michalrud/ThetaCloud/events","assignees_url":"https://api.github.com/repos/michalrud/ThetaCloud/assignees{/user}","branches_url":"https://api.github.com/repos/michalrud/ThetaCloud/branches{/branch}","tags_url":"https://api.github.com/repos/michalrud/ThetaCloud/tags","blobs_url":"https://api.github.com/repos/michalrud/ThetaCloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michalrud/ThetaCloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michalrud/ThetaCloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/michalrud/ThetaCloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michalrud/ThetaCloud/statuses/{sha}","languages_url":"https://api.github.com/repos/michalrud/ThetaCloud/languages","stargazers_url":"https://api.github.com/repos/michalrud/ThetaCloud/stargazers","contributors_url":"https://api.github.com/repos/michalrud/ThetaCloud/contributors","subscribers_url":"https://api.github.com/repos/michalrud/ThetaCloud/subscribers","subscription_url":"https://api.github.com/repos/michalrud/ThetaCloud/subscription","commits_url":"https://api.github.com/repos/michalrud/ThetaCloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/michalrud/ThetaCloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/michalrud/ThetaCloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/michalrud/ThetaCloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/michalrud/ThetaCloud/contents/{+path}","compare_url":"https://api.github.com/repos/michalrud/ThetaCloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michalrud/ThetaCloud/merges","archive_url":"https://api.github.com/repos/michalrud/ThetaCloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michalrud/ThetaCloud/downloads","issues_url":"https://api.github.com/repos/michalrud/ThetaCloud/issues{/number}","pulls_url":"https://api.github.com/repos/michalrud/ThetaCloud/pulls{/number}","milestones_url":"https://api.github.com/repos/michalrud/ThetaCloud/milestones{/number}","notifications_url":"https://api.github.com/repos/michalrud/ThetaCloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michalrud/ThetaCloud/labels{/name}","releases_url":"https://api.github.com/repos/michalrud/ThetaCloud/releases{/id}","deployments_url":"https://api.github.com/repos/michalrud/ThetaCloud/deployments","created_at":"2018-07-06T07:52:37Z","updated_at":"2018-07-06T09:54:48Z","pushed_at":"2018-07-06T10:44:35Z","git_url":"git://github.com/michalrud/ThetaCloud.git","ssh_url":"git@github.com:michalrud/ThetaCloud.git","clone_url":"https://github.com/michalrud/ThetaCloud.git","svn_url":"https://github.com/michalrud/ThetaCloud","homepage":"https://thetacloud.readthedocs.io/en/latest/","size":140,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/1"},"html":{"href":"https://github.com/michalrud/ThetaCloud/pull/1"},"issue":{"href":"https://api.github.com/repos/michalrud/ThetaCloud/issues/1"},"comments":{"href":"https://api.github.com/repos/michalrud/ThetaCloud/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/michalrud/ThetaCloud/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/michalrud/ThetaCloud/statuses/a30892349152e91f51257ac84d1922cd3eeecc2d"}},"author_association":"OWNER"}}
{"actor":{"display_login":"michalrud"}}