{"action":"created","comment":{"url":"https://api.github.com/repos/ros2/rosidl_dds/pulls/comments/34322329","id":34322329,"diff_hunk":"@@ -39,6 +39,42 @@ namespace rosidl_typesupport_introspection_cpp\n {\n \n @[if spec.fields]@\n+@[for field in spec.fields]@\n+@[if not field.type.is_primitive_type() and field.type.is_array]@\n+size_t size_function__@(spec.base_type.type)__@(field.name)(const void * untyped_member)\n+{\n+@[if field.type.array_size and not field.type.is_upper_bound]@\n+  return @(field.type.array_size);\n+@[else]@\n+  const std::vector<@(field.type.pkg_name)::msg::@(field.type.type)> * member =\n+    reinterpret_cast<const std::vector<@(field.type.pkg_name)::msg::@(field.type.type)> *>(untyped_member);\n+  return member->size();\n+@[end if]@\n+}\n+\n+const void * get_function__@(spec.base_type.type)__@(field.name)(const void * untyped_member, size_t index)\n+{\n+@[if field.type.array_size and not field.type.is_upper_bound]@\n+  const @(field.type.pkg_name)::msg::@(field.type.type) * member =\n+    reinterpret_cast<const @(field.type.pkg_name)::msg::@(field.type.type) *>(untyped_member);\n+@[else]@\n+  const std::vector<@(field.type.pkg_name)::msg::@(field.type.type)> & member =\n+    *reinterpret_cast<const std::vector<@(field.type.pkg_name)::msg::@(field.type.type)> *>(untyped_member);\n+@[end if]@\n+  return &member[index];","path":"rosidl_typesupport_introspection_cpp/resource/msg__type_support.cpp.template","position":26,"original_position":26,"commit_id":"6bbcca6a799122c1eb378be75d8402c1e79a4111","original_commit_id":"6bbcca6a799122c1eb378be75d8402c1e79a4111","user":{"login":"jacquelinekay","id":495933,"avatar_url":"https://avatars.githubusercontent.com/u/495933?v=3","gravatar_id":"","url":"https://api.github.com/users/jacquelinekay","html_url":"https://github.com/jacquelinekay","followers_url":"https://api.github.com/users/jacquelinekay/followers","following_url":"https://api.github.com/users/jacquelinekay/following{/other_user}","gists_url":"https://api.github.com/users/jacquelinekay/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquelinekay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquelinekay/subscriptions","organizations_url":"https://api.github.com/users/jacquelinekay/orgs","repos_url":"https://api.github.com/users/jacquelinekay/repos","events_url":"https://api.github.com/users/jacquelinekay/events{/privacy}","received_events_url":"https://api.github.com/users/jacquelinekay/received_events","type":"User","site_admin":false},"body":"should you check if index is within the bounds of the vector, or do you expect to do error handling outside of this function?","created_at":"2015-07-10T01:46:49Z","updated_at":"2015-07-10T01:46:49Z","html_url":"https://github.com/ros2/rosidl_dds/pull/23#discussion_r34322329","pull_request_url":"https://api.github.com/repos/ros2/rosidl_dds/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/ros2/rosidl_dds/pulls/comments/34322329"},"html":{"href":"https://github.com/ros2/rosidl_dds/pull/23#discussion_r34322329"},"pull_request":{"href":"https://api.github.com/repos/ros2/rosidl_dds/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/ros2/rosidl_dds/pulls/23","id":39638650,"html_url":"https://github.com/ros2/rosidl_dds/pull/23","diff_url":"https://github.com/ros2/rosidl_dds/pull/23.diff","patch_url":"https://github.com/ros2/rosidl_dds/pull/23.patch","issue_url":"https://api.github.com/repos/ros2/rosidl_dds/issues/23","number":23,"state":"open","locked":false,"title":"extend introspection with functions for array operations","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":"This builds on top of #22.","created_at":"2015-07-09T23:18:45Z","updated_at":"2015-07-10T01:46:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0e9d904891c248f1dbe586cd3b21f7d93a7992ff","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/ros2/rosidl_dds/pulls/23/commits","review_comments_url":"https://api.github.com/repos/ros2/rosidl_dds/pulls/23/comments","review_comment_url":"https://api.github.com/repos/ros2/rosidl_dds/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros2/rosidl_dds/issues/23/comments","statuses_url":"https://api.github.com/repos/ros2/rosidl_dds/statuses/6bbcca6a799122c1eb378be75d8402c1e79a4111","head":{"label":"ros2:extend_introspection_with_array_operations","ref":"extend_introspection_with_array_operations","sha":"6bbcca6a799122c1eb378be75d8402c1e79a4111","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":22737296,"name":"rosidl_dds","full_name":"ros2/rosidl_dds","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/rosidl_dds","description":"","fork":false,"url":"https://api.github.com/repos/ros2/rosidl_dds","forks_url":"https://api.github.com/repos/ros2/rosidl_dds/forks","keys_url":"https://api.github.com/repos/ros2/rosidl_dds/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rosidl_dds/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rosidl_dds/teams","hooks_url":"https://api.github.com/repos/ros2/rosidl_dds/hooks","issue_events_url":"https://api.github.com/repos/ros2/rosidl_dds/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rosidl_dds/events","assignees_url":"https://api.github.com/repos/ros2/rosidl_dds/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rosidl_dds/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rosidl_dds/tags","blobs_url":"https://api.github.com/repos/ros2/rosidl_dds/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rosidl_dds/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rosidl_dds/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rosidl_dds/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rosidl_dds/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rosidl_dds/languages","stargazers_url":"https://api.github.com/repos/ros2/rosidl_dds/stargazers","contributors_url":"https://api.github.com/repos/ros2/rosidl_dds/contributors","subscribers_url":"https://api.github.com/repos/ros2/rosidl_dds/subscribers","subscription_url":"https://api.github.com/repos/ros2/rosidl_dds/subscription","commits_url":"https://api.github.com/repos/ros2/rosidl_dds/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rosidl_dds/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rosidl_dds/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rosidl_dds/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rosidl_dds/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rosidl_dds/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rosidl_dds/merges","archive_url":"https://api.github.com/repos/ros2/rosidl_dds/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rosidl_dds/downloads","issues_url":"https://api.github.com/repos/ros2/rosidl_dds/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rosidl_dds/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rosidl_dds/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rosidl_dds/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rosidl_dds/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rosidl_dds/releases{/id}","created_at":"2014-08-07T21:35:07Z","updated_at":"2015-05-01T01:01:20Z","pushed_at":"2015-07-09T23:23:49Z","git_url":"git://github.com/ros2/rosidl_dds.git","ssh_url":"git@github.com:ros2/rosidl_dds.git","clone_url":"https://github.com/ros2/rosidl_dds.git","svn_url":"https://github.com/ros2/rosidl_dds","homepage":null,"size":752,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"ros2:master","ref":"master","sha":"32c4c22ab6784ed245d5399d37ac09628fde6d2b","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":22737296,"name":"rosidl_dds","full_name":"ros2/rosidl_dds","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/rosidl_dds","description":"","fork":false,"url":"https://api.github.com/repos/ros2/rosidl_dds","forks_url":"https://api.github.com/repos/ros2/rosidl_dds/forks","keys_url":"https://api.github.com/repos/ros2/rosidl_dds/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rosidl_dds/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rosidl_dds/teams","hooks_url":"https://api.github.com/repos/ros2/rosidl_dds/hooks","issue_events_url":"https://api.github.com/repos/ros2/rosidl_dds/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rosidl_dds/events","assignees_url":"https://api.github.com/repos/ros2/rosidl_dds/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rosidl_dds/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rosidl_dds/tags","blobs_url":"https://api.github.com/repos/ros2/rosidl_dds/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rosidl_dds/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rosidl_dds/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rosidl_dds/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rosidl_dds/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rosidl_dds/languages","stargazers_url":"https://api.github.com/repos/ros2/rosidl_dds/stargazers","contributors_url":"https://api.github.com/repos/ros2/rosidl_dds/contributors","subscribers_url":"https://api.github.com/repos/ros2/rosidl_dds/subscribers","subscription_url":"https://api.github.com/repos/ros2/rosidl_dds/subscription","commits_url":"https://api.github.com/repos/ros2/rosidl_dds/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rosidl_dds/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rosidl_dds/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rosidl_dds/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rosidl_dds/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rosidl_dds/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rosidl_dds/merges","archive_url":"https://api.github.com/repos/ros2/rosidl_dds/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rosidl_dds/downloads","issues_url":"https://api.github.com/repos/ros2/rosidl_dds/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rosidl_dds/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rosidl_dds/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rosidl_dds/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rosidl_dds/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rosidl_dds/releases{/id}","created_at":"2014-08-07T21:35:07Z","updated_at":"2015-05-01T01:01:20Z","pushed_at":"2015-07-09T23:23:49Z","git_url":"git://github.com/ros2/rosidl_dds.git","ssh_url":"git@github.com:ros2/rosidl_dds.git","clone_url":"https://github.com/ros2/rosidl_dds.git","svn_url":"https://github.com/ros2/rosidl_dds","homepage":null,"size":752,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ros2/rosidl_dds/pulls/23"},"html":{"href":"https://github.com/ros2/rosidl_dds/pull/23"},"issue":{"href":"https://api.github.com/repos/ros2/rosidl_dds/issues/23"},"comments":{"href":"https://api.github.com/repos/ros2/rosidl_dds/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/ros2/rosidl_dds/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/ros2/rosidl_dds/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros2/rosidl_dds/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/ros2/rosidl_dds/statuses/6bbcca6a799122c1eb378be75d8402c1e79a4111"}}}}