{"action":"created","comment":{"url":"https://api.github.com/repos/ros2/rcl/pulls/comments/47814464","id":47814464,"diff_hunk":"@@ -0,0 +1,127 @@\n+// Copyright 2015 Open Source Robotics Foundation, Inc.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+#ifndef RCL__TIME_H_\n+#define RCL__TIME_H_\n+\n+#if __cplusplus\n+extern \"C\"\n+{\n+#endif\n+\n+#include \"rcl/types.h\"\n+#include \"rcl/visibility_control.h\"\n+\n+#define RCL_S_TO_NS(seconds) (seconds * 1000000000)","path":"rcl/include/rcl/time.h","position":26,"original_position":26,"commit_id":"88c503e7e596fbc6caa2f7e9ae13f6a1e746fd85","original_commit_id":"52da897e225a8141035e97215f5f39f155de0c36","user":{"login":"dirk-thomas","id":1335366,"avatar_url":"https://avatars.githubusercontent.com/u/1335366?v=3","gravatar_id":"","url":"https://api.github.com/users/dirk-thomas","html_url":"https://github.com/dirk-thomas","followers_url":"https://api.github.com/users/dirk-thomas/followers","following_url":"https://api.github.com/users/dirk-thomas/following{/other_user}","gists_url":"https://api.github.com/users/dirk-thomas/gists{/gist_id}","starred_url":"https://api.github.com/users/dirk-thomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirk-thomas/subscriptions","organizations_url":"https://api.github.com/users/dirk-thomas/orgs","repos_url":"https://api.github.com/users/dirk-thomas/repos","events_url":"https://api.github.com/users/dirk-thomas/events{/privacy}","received_events_url":"https://api.github.com/users/dirk-thomas/received_events","type":"User","site_admin":false},"body":"For better readability should we split long constant numbers into more readable factors:\r\n\r\n    seconds * 1000 * 1000 * 1000","created_at":"2015-12-16T18:34:42Z","updated_at":"2015-12-16T18:34:42Z","html_url":"https://github.com/ros2/rcl/pull/5#discussion_r47814464","pull_request_url":"https://api.github.com/repos/ros2/rcl/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/ros2/rcl/pulls/comments/47814464"},"html":{"href":"https://github.com/ros2/rcl/pull/5#discussion_r47814464"},"pull_request":{"href":"https://api.github.com/repos/ros2/rcl/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/ros2/rcl/pulls/5","id":51612924,"html_url":"https://github.com/ros2/rcl/pull/5","diff_url":"https://github.com/ros2/rcl/pull/5.diff","patch_url":"https://github.com/ros2/rcl/pull/5.patch","issue_url":"https://api.github.com/repos/ros2/rcl/issues/5","number":5,"state":"open","locked":false,"title":"refactor rcl into a functional library","user":{"login":"wjwwood","id":100427,"avatar_url":"https://avatars.githubusercontent.com/u/100427?v=3","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false},"body":"Currently `rcl` is just an idea and not being used. This pull request will refactor it into a working library which can be used by client libraries and which is a super set of the `rmw` functionality. The scope of this pull request is just for initialization, nodes, publishers, subscriptions, guard conditions, and waiting. This will allow prototyping of the Python API implementation while we work on services (client and server), execution logic, and parameters separately in a follow up pull request.\r\n\r\nThis is a work in progress still, I need to:\r\n\r\n- [x] redesign the headers; removing functions for things out scope (services, etc...)\r\n - [x] I need to go over all the functions and think about alternative return code (not just ok and error)\r\n - [x] I need to make sure the use of `[in]`, `[out]`, and `[inout]` is consistent\r\n - [x] I need to consider `const`-ness of parameters and return types.\r\n - [x] I need to address as many of the TODO's in the code as possible (maybe after feedback)\r\n - [x] I need to add macros for visibility.\r\n - [ ] I need to add warnings about not checking return codes.\r\n- [x] implement the headers in a shared library ~~which is rmw implementation agnostic~~\r\n- [ ] implement tests which use the rcl functions:\r\n - [x] allocator\r\n - [x] guard_condition\r\n - [ ] node\r\n - [ ] publisher\r\n - [x] rcl\r\n - [ ] subscription\r\n - [x] time\r\n - [ ] timer\r\n - [ ] wait\r\n\r\nAnd then obviously iterate on feedback from review.\r\n\r\n---\r\n\r\nI'm using C11 atomics for their semantic value, on unsupported OS's there are other options:\r\n\r\n- https://gist.github.com/nhatminhle/5181506 (for clang and gcc versions that don't implement)\r\n- https://github.com/mintomic/mintomic (potential general solution when C11 atomics are not available)","created_at":"2015-11-24T03:25:25Z","updated_at":"2015-12-16T18:34:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b699b8da503ac85333344462171939df1370edc7","assignee":{"login":"wjwwood","id":100427,"avatar_url":"https://avatars.githubusercontent.com/u/100427?v=3","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ros2/rcl/pulls/5/commits","review_comments_url":"https://api.github.com/repos/ros2/rcl/pulls/5/comments","review_comment_url":"https://api.github.com/repos/ros2/rcl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros2/rcl/issues/5/comments","statuses_url":"https://api.github.com/repos/ros2/rcl/statuses/88c503e7e596fbc6caa2f7e9ae13f6a1e746fd85","head":{"label":"ros2:rcl_refactor","ref":"rcl_refactor","sha":"88c503e7e596fbc6caa2f7e9ae13f6a1e746fd85","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":31091419,"name":"rcl","full_name":"ros2/rcl","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/rcl","description":"Library to support implementation of language specific ROS Client Libraries.","fork":false,"url":"https://api.github.com/repos/ros2/rcl","forks_url":"https://api.github.com/repos/ros2/rcl/forks","keys_url":"https://api.github.com/repos/ros2/rcl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rcl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rcl/teams","hooks_url":"https://api.github.com/repos/ros2/rcl/hooks","issue_events_url":"https://api.github.com/repos/ros2/rcl/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rcl/events","assignees_url":"https://api.github.com/repos/ros2/rcl/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rcl/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rcl/tags","blobs_url":"https://api.github.com/repos/ros2/rcl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rcl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rcl/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rcl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rcl/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rcl/languages","stargazers_url":"https://api.github.com/repos/ros2/rcl/stargazers","contributors_url":"https://api.github.com/repos/ros2/rcl/contributors","subscribers_url":"https://api.github.com/repos/ros2/rcl/subscribers","subscription_url":"https://api.github.com/repos/ros2/rcl/subscription","commits_url":"https://api.github.com/repos/ros2/rcl/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rcl/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rcl/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rcl/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rcl/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rcl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rcl/merges","archive_url":"https://api.github.com/repos/ros2/rcl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rcl/downloads","issues_url":"https://api.github.com/repos/ros2/rcl/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rcl/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rcl/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rcl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rcl/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rcl/releases{/id}","created_at":"2015-02-21T00:06:40Z","updated_at":"2015-10-06T14:39:16Z","pushed_at":"2015-12-16T18:31:22Z","git_url":"git://github.com/ros2/rcl.git","ssh_url":"git@github.com:ros2/rcl.git","clone_url":"https://github.com/ros2/rcl.git","svn_url":"https://github.com/ros2/rcl","homepage":null,"size":144,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"ros2:master","ref":"master","sha":"d0083b725b35c762c6f8eafc02734d6b75d1d133","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":31091419,"name":"rcl","full_name":"ros2/rcl","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/rcl","description":"Library to support implementation of language specific ROS Client Libraries.","fork":false,"url":"https://api.github.com/repos/ros2/rcl","forks_url":"https://api.github.com/repos/ros2/rcl/forks","keys_url":"https://api.github.com/repos/ros2/rcl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rcl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rcl/teams","hooks_url":"https://api.github.com/repos/ros2/rcl/hooks","issue_events_url":"https://api.github.com/repos/ros2/rcl/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rcl/events","assignees_url":"https://api.github.com/repos/ros2/rcl/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rcl/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rcl/tags","blobs_url":"https://api.github.com/repos/ros2/rcl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rcl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rcl/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rcl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rcl/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rcl/languages","stargazers_url":"https://api.github.com/repos/ros2/rcl/stargazers","contributors_url":"https://api.github.com/repos/ros2/rcl/contributors","subscribers_url":"https://api.github.com/repos/ros2/rcl/subscribers","subscription_url":"https://api.github.com/repos/ros2/rcl/subscription","commits_url":"https://api.github.com/repos/ros2/rcl/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rcl/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rcl/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rcl/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rcl/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rcl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rcl/merges","archive_url":"https://api.github.com/repos/ros2/rcl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rcl/downloads","issues_url":"https://api.github.com/repos/ros2/rcl/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rcl/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rcl/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rcl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rcl/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rcl/releases{/id}","created_at":"2015-02-21T00:06:40Z","updated_at":"2015-10-06T14:39:16Z","pushed_at":"2015-12-16T18:31:22Z","git_url":"git://github.com/ros2/rcl.git","ssh_url":"git@github.com:ros2/rcl.git","clone_url":"https://github.com/ros2/rcl.git","svn_url":"https://github.com/ros2/rcl","homepage":null,"size":144,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ros2/rcl/pulls/5"},"html":{"href":"https://github.com/ros2/rcl/pull/5"},"issue":{"href":"https://api.github.com/repos/ros2/rcl/issues/5"},"comments":{"href":"https://api.github.com/repos/ros2/rcl/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/ros2/rcl/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/ros2/rcl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros2/rcl/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/ros2/rcl/statuses/88c503e7e596fbc6caa2f7e9ae13f6a1e746fd85"}}}}