{"action":"created","comment":{"url":"https://api.github.com/repos/cellml/libcellml/pulls/comments/34116854","id":34116854,"diff_hunk":"@@ -67,6 +67,78 @@ class LIBCELLML_EXPORT Model: public Nameable\n      */\n     void addComponent(const Component &c);\n \n+    /**\n+     * @brief remove the component at the given index.\n+     * Remove the component at the given index.  If the index is\n+     * not in the range 0, componentCount then an exception will\n+     * be raised.\n+     * @param index the index of the component to remove.\n+     */\n+    void removeComponent(size_t index);\n+\n+    /**\n+     * @brief remove the component at the given index.\n+     * Remove the component with the given name.  This method will\n+     * remove the first component that is found and return.  If the\n+     * name is not found no component is removed.\n+     * @param name the name of the component to remove.\n+     */\n+    void removeComponent(const std::string &name);\n+\n+    /**\n+     * @brief tests to see if the component is contained within the Model.\n+     * Tests to see if the component is contained within the Model.  Returns\n+     * true if the component is in the Model and false otherwise.\n+     * @param name the name of the component to test for existence in the Model.\n+     * @return true if the named component is in the model and false otherwise.\n+     */\n+    bool containsComponent(const std::string &name);\n+\n+    /**\n+     * @brief get a component at index.\n+     * Returns a const reference to a component at the given index.  If the\n+     * index is not valid std::runtime_error exception is thrown.\n+     * @param index The index of the component to return\n+     * @return a reference to the component at the given index\n+     */\n+    const Component& getComponent(size_t index) const;\n+\n+    /**\n+     * @brief get a component at index.\n+     * Returns a reference to a component at the given index.  If the index\n+     * is not valid std::runtime_error exception is thrown.\n+     * This is an overloaded method.\n+     * @param index The index of the component to return\n+     * @return a reference to the component at the given index\n+     */\n+    Component& getComponent(size_t index);\n+\n+    /**\n+     * @brief take the component at the given index and return it.\n+     * Removes the component at the given index position and returns it.\n+     * If an invalid index is passed to the method a std::runtime_error\n+     * exception is thrown.\n+     * @param index the index of the component to take.\n+     * @return the component at the given index.\n+     */\n+    Component takeComponentAt(size_t index);","path":"src/api/libcellml/model.h","position":67,"original_position":67,"commit_id":"c08ece4716cddcd7899cf1e2ebd1f9a034e17a50","original_commit_id":"c08ece4716cddcd7899cf1e2ebd1f9a034e17a50","user":{"login":"nickerso","id":811244,"avatar_url":"https://avatars.githubusercontent.com/u/811244?v=3","gravatar_id":"","url":"https://api.github.com/users/nickerso","html_url":"https://github.com/nickerso","followers_url":"https://api.github.com/users/nickerso/followers","following_url":"https://api.github.com/users/nickerso/following{/other_user}","gists_url":"https://api.github.com/users/nickerso/gists{/gist_id}","starred_url":"https://api.github.com/users/nickerso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickerso/subscriptions","organizations_url":"https://api.github.com/users/nickerso/orgs","repos_url":"https://api.github.com/users/nickerso/repos","events_url":"https://api.github.com/users/nickerso/events{/privacy}","received_events_url":"https://api.github.com/users/nickerso/received_events","type":"User","site_admin":false},"body":"following the other `*Component` methods, I would expect to have a `takeComponent(size_t index)` and a `takeComponent(const std::string& name)` method.","created_at":"2015-07-08T05:27:50Z","updated_at":"2015-07-08T05:27:50Z","html_url":"https://github.com/cellml/libcellml/pull/36#discussion_r34116854","pull_request_url":"https://api.github.com/repos/cellml/libcellml/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/cellml/libcellml/pulls/comments/34116854"},"html":{"href":"https://github.com/cellml/libcellml/pull/36#discussion_r34116854"},"pull_request":{"href":"https://api.github.com/repos/cellml/libcellml/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/cellml/libcellml/pulls/36","id":39203864,"html_url":"https://github.com/cellml/libcellml/pull/36","diff_url":"https://github.com/cellml/libcellml/pull/36.diff","patch_url":"https://github.com/cellml/libcellml/pull/36.patch","issue_url":"https://api.github.com/repos/cellml/libcellml/issues/36","number":36,"state":"open","locked":false,"title":"Implementation for usecases upto 1vii","user":{"login":"hsorby","id":778048,"avatar_url":"https://avatars.githubusercontent.com/u/778048?v=3","gravatar_id":"","url":"https://api.github.com/users/hsorby","html_url":"https://github.com/hsorby","followers_url":"https://api.github.com/users/hsorby/followers","following_url":"https://api.github.com/users/hsorby/following{/other_user}","gists_url":"https://api.github.com/users/hsorby/gists{/gist_id}","starred_url":"https://api.github.com/users/hsorby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsorby/subscriptions","organizations_url":"https://api.github.com/users/hsorby/orgs","repos_url":"https://api.github.com/users/hsorby/repos","events_url":"https://api.github.com/users/hsorby/events{/privacy}","received_events_url":"https://api.github.com/users/hsorby/received_events","type":"User","site_admin":false},"body":"Add initial component count test and skeleton code to successfully compile the codebase.","created_at":"2015-07-04T07:05:54Z","updated_at":"2015-07-08T05:27:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e868567b9e687b14eda76457689106be25698579","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cellml/libcellml/pulls/36/commits","review_comments_url":"https://api.github.com/repos/cellml/libcellml/pulls/36/comments","review_comment_url":"https://api.github.com/repos/cellml/libcellml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cellml/libcellml/issues/36/comments","statuses_url":"https://api.github.com/repos/cellml/libcellml/statuses/c08ece4716cddcd7899cf1e2ebd1f9a034e17a50","head":{"label":"hsorby:usecases_upto_1vii","ref":"usecases_upto_1vii","sha":"c08ece4716cddcd7899cf1e2ebd1f9a034e17a50","user":{"login":"hsorby","id":778048,"avatar_url":"https://avatars.githubusercontent.com/u/778048?v=3","gravatar_id":"","url":"https://api.github.com/users/hsorby","html_url":"https://github.com/hsorby","followers_url":"https://api.github.com/users/hsorby/followers","following_url":"https://api.github.com/users/hsorby/following{/other_user}","gists_url":"https://api.github.com/users/hsorby/gists{/gist_id}","starred_url":"https://api.github.com/users/hsorby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsorby/subscriptions","organizations_url":"https://api.github.com/users/hsorby/orgs","repos_url":"https://api.github.com/users/hsorby/repos","events_url":"https://api.github.com/users/hsorby/events{/privacy}","received_events_url":"https://api.github.com/users/hsorby/received_events","type":"User","site_admin":false},"repo":{"id":34034875,"name":"libcellml","full_name":"hsorby/libcellml","owner":{"login":"hsorby","id":778048,"avatar_url":"https://avatars.githubusercontent.com/u/778048?v=3","gravatar_id":"","url":"https://api.github.com/users/hsorby","html_url":"https://github.com/hsorby","followers_url":"https://api.github.com/users/hsorby/followers","following_url":"https://api.github.com/users/hsorby/following{/other_user}","gists_url":"https://api.github.com/users/hsorby/gists{/gist_id}","starred_url":"https://api.github.com/users/hsorby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsorby/subscriptions","organizations_url":"https://api.github.com/users/hsorby/orgs","repos_url":"https://api.github.com/users/hsorby/repos","events_url":"https://api.github.com/users/hsorby/events{/privacy}","received_events_url":"https://api.github.com/users/hsorby/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hsorby/libcellml","description":"Prime repository for libCellML development.","fork":true,"url":"https://api.github.com/repos/hsorby/libcellml","forks_url":"https://api.github.com/repos/hsorby/libcellml/forks","keys_url":"https://api.github.com/repos/hsorby/libcellml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hsorby/libcellml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hsorby/libcellml/teams","hooks_url":"https://api.github.com/repos/hsorby/libcellml/hooks","issue_events_url":"https://api.github.com/repos/hsorby/libcellml/issues/events{/number}","events_url":"https://api.github.com/repos/hsorby/libcellml/events","assignees_url":"https://api.github.com/repos/hsorby/libcellml/assignees{/user}","branches_url":"https://api.github.com/repos/hsorby/libcellml/branches{/branch}","tags_url":"https://api.github.com/repos/hsorby/libcellml/tags","blobs_url":"https://api.github.com/repos/hsorby/libcellml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hsorby/libcellml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hsorby/libcellml/git/refs{/sha}","trees_url":"https://api.github.com/repos/hsorby/libcellml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hsorby/libcellml/statuses/{sha}","languages_url":"https://api.github.com/repos/hsorby/libcellml/languages","stargazers_url":"https://api.github.com/repos/hsorby/libcellml/stargazers","contributors_url":"https://api.github.com/repos/hsorby/libcellml/contributors","subscribers_url":"https://api.github.com/repos/hsorby/libcellml/subscribers","subscription_url":"https://api.github.com/repos/hsorby/libcellml/subscription","commits_url":"https://api.github.com/repos/hsorby/libcellml/commits{/sha}","git_commits_url":"https://api.github.com/repos/hsorby/libcellml/git/commits{/sha}","comments_url":"https://api.github.com/repos/hsorby/libcellml/comments{/number}","issue_comment_url":"https://api.github.com/repos/hsorby/libcellml/issues/comments{/number}","contents_url":"https://api.github.com/repos/hsorby/libcellml/contents/{+path}","compare_url":"https://api.github.com/repos/hsorby/libcellml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hsorby/libcellml/merges","archive_url":"https://api.github.com/repos/hsorby/libcellml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hsorby/libcellml/downloads","issues_url":"https://api.github.com/repos/hsorby/libcellml/issues{/number}","pulls_url":"https://api.github.com/repos/hsorby/libcellml/pulls{/number}","milestones_url":"https://api.github.com/repos/hsorby/libcellml/milestones{/number}","notifications_url":"https://api.github.com/repos/hsorby/libcellml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hsorby/libcellml/labels{/name}","releases_url":"https://api.github.com/repos/hsorby/libcellml/releases{/id}","created_at":"2015-04-16T04:48:03Z","updated_at":"2015-04-28T00:42:01Z","pushed_at":"2015-07-07T08:59:06Z","git_url":"git://github.com/hsorby/libcellml.git","ssh_url":"git@github.com:hsorby/libcellml.git","clone_url":"https://github.com/hsorby/libcellml.git","svn_url":"https://github.com/hsorby/libcellml","homepage":null,"size":3350,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"cellml:develop","ref":"develop","sha":"0f7a9595a85bd49363a4eba819d4d6cac4f7f751","user":{"login":"cellml","id":2141414,"avatar_url":"https://avatars.githubusercontent.com/u/2141414?v=3","gravatar_id":"","url":"https://api.github.com/users/cellml","html_url":"https://github.com/cellml","followers_url":"https://api.github.com/users/cellml/followers","following_url":"https://api.github.com/users/cellml/following{/other_user}","gists_url":"https://api.github.com/users/cellml/gists{/gist_id}","starred_url":"https://api.github.com/users/cellml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cellml/subscriptions","organizations_url":"https://api.github.com/users/cellml/orgs","repos_url":"https://api.github.com/users/cellml/repos","events_url":"https://api.github.com/users/cellml/events{/privacy}","received_events_url":"https://api.github.com/users/cellml/received_events","type":"Organization","site_admin":false},"repo":{"id":34033740,"name":"libcellml","full_name":"cellml/libcellml","owner":{"login":"cellml","id":2141414,"avatar_url":"https://avatars.githubusercontent.com/u/2141414?v=3","gravatar_id":"","url":"https://api.github.com/users/cellml","html_url":"https://github.com/cellml","followers_url":"https://api.github.com/users/cellml/followers","following_url":"https://api.github.com/users/cellml/following{/other_user}","gists_url":"https://api.github.com/users/cellml/gists{/gist_id}","starred_url":"https://api.github.com/users/cellml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cellml/subscriptions","organizations_url":"https://api.github.com/users/cellml/orgs","repos_url":"https://api.github.com/users/cellml/repos","events_url":"https://api.github.com/users/cellml/events{/privacy}","received_events_url":"https://api.github.com/users/cellml/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cellml/libcellml","description":"Repository for libCellML development.","fork":false,"url":"https://api.github.com/repos/cellml/libcellml","forks_url":"https://api.github.com/repos/cellml/libcellml/forks","keys_url":"https://api.github.com/repos/cellml/libcellml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cellml/libcellml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cellml/libcellml/teams","hooks_url":"https://api.github.com/repos/cellml/libcellml/hooks","issue_events_url":"https://api.github.com/repos/cellml/libcellml/issues/events{/number}","events_url":"https://api.github.com/repos/cellml/libcellml/events","assignees_url":"https://api.github.com/repos/cellml/libcellml/assignees{/user}","branches_url":"https://api.github.com/repos/cellml/libcellml/branches{/branch}","tags_url":"https://api.github.com/repos/cellml/libcellml/tags","blobs_url":"https://api.github.com/repos/cellml/libcellml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cellml/libcellml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cellml/libcellml/git/refs{/sha}","trees_url":"https://api.github.com/repos/cellml/libcellml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cellml/libcellml/statuses/{sha}","languages_url":"https://api.github.com/repos/cellml/libcellml/languages","stargazers_url":"https://api.github.com/repos/cellml/libcellml/stargazers","contributors_url":"https://api.github.com/repos/cellml/libcellml/contributors","subscribers_url":"https://api.github.com/repos/cellml/libcellml/subscribers","subscription_url":"https://api.github.com/repos/cellml/libcellml/subscription","commits_url":"https://api.github.com/repos/cellml/libcellml/commits{/sha}","git_commits_url":"https://api.github.com/repos/cellml/libcellml/git/commits{/sha}","comments_url":"https://api.github.com/repos/cellml/libcellml/comments{/number}","issue_comment_url":"https://api.github.com/repos/cellml/libcellml/issues/comments{/number}","contents_url":"https://api.github.com/repos/cellml/libcellml/contents/{+path}","compare_url":"https://api.github.com/repos/cellml/libcellml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cellml/libcellml/merges","archive_url":"https://api.github.com/repos/cellml/libcellml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cellml/libcellml/downloads","issues_url":"https://api.github.com/repos/cellml/libcellml/issues{/number}","pulls_url":"https://api.github.com/repos/cellml/libcellml/pulls{/number}","milestones_url":"https://api.github.com/repos/cellml/libcellml/milestones{/number}","notifications_url":"https://api.github.com/repos/cellml/libcellml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cellml/libcellml/labels{/name}","releases_url":"https://api.github.com/repos/cellml/libcellml/releases{/id}","created_at":"2015-04-16T04:10:34Z","updated_at":"2015-05-11T23:32:47Z","pushed_at":"2015-07-07T08:59:06Z","git_url":"git://github.com/cellml/libcellml.git","ssh_url":"git@github.com:cellml/libcellml.git","clone_url":"https://github.com/cellml/libcellml.git","svn_url":"https://github.com/cellml/libcellml","homepage":"","size":3439,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":6,"forks":2,"open_issues":6,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/cellml/libcellml/pulls/36"},"html":{"href":"https://github.com/cellml/libcellml/pull/36"},"issue":{"href":"https://api.github.com/repos/cellml/libcellml/issues/36"},"comments":{"href":"https://api.github.com/repos/cellml/libcellml/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/cellml/libcellml/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/cellml/libcellml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cellml/libcellml/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/cellml/libcellml/statuses/c08ece4716cddcd7899cf1e2ebd1f9a034e17a50"}}}}