{"action":"created","comment":{"url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/comments/54859000","id":54859000,"diff_hunk":"@@ -50,35 +50,61 @@ AlarmFilter AlarmFilter::_instance;\n \n AlarmTrapSender AlarmTrapSender::_instance;\n \n-bool ActiveAlarmList::update(AlarmTableDef& alarm_table_def, const std::string& issuer)\n+bool ObservedAlarms::update(AlarmTableDef& alarm_table_def, const std::string& issuer)\n {\n-  bool updated = false;\n+  bool send_trap = false;\n \n   std::map<unsigned int, AlarmListEntry>::iterator it = _index_to_entry.find(alarm_table_def.alarm_index());\n-\n+  \n+  // Enter this if statement if the alarm we are currently raising is being\n+  // raised with a non-CLEARED severity. \n   if (alarm_table_def.is_not_clear())","path":"alarm_trap_sender.cpp","position":15,"original_position":15,"commit_id":"fc5d80e2f717bbdf1fea913aad8de8f51f9b8451","original_commit_id":"fc5d80e2f717bbdf1fea913aad8de8f51f9b8451","user":{"login":"AlexHockey","id":4903205,"avatar_url":"https://avatars.githubusercontent.com/u/4903205?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexHockey","html_url":"https://github.com/AlexHockey","followers_url":"https://api.github.com/users/AlexHockey/followers","following_url":"https://api.github.com/users/AlexHockey/following{/other_user}","gists_url":"https://api.github.com/users/AlexHockey/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexHockey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexHockey/subscriptions","organizations_url":"https://api.github.com/users/AlexHockey/orgs","repos_url":"https://api.github.com/users/AlexHockey/repos","events_url":"https://api.github.com/users/AlexHockey/events{/privacy}","received_events_url":"https://api.github.com/users/AlexHockey/received_events","type":"User","site_admin":false},"body":"Agreed. This also means that `update` and `override` are basically the same function, except that the latter doesn't return whether an update happened. If the caller does not care about this, it could just call `update` and ignore the return code, so we can bin `override` entirely. ","created_at":"2016-03-03T10:06:07Z","updated_at":"2016-03-03T10:06:07Z","html_url":"https://github.com/Metaswitch/clearwater-snmp-handlers/pull/125#discussion_r54859000","pull_request_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/125","_links":{"self":{"href":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/comments/54859000"},"html":{"href":"https://github.com/Metaswitch/clearwater-snmp-handlers/pull/125#discussion_r54859000"},"pull_request":{"href":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/125","id":61400321,"html_url":"https://github.com/Metaswitch/clearwater-snmp-handlers/pull/125","diff_url":"https://github.com/Metaswitch/clearwater-snmp-handlers/pull/125.diff","patch_url":"https://github.com/Metaswitch/clearwater-snmp-handlers/pull/125.patch","issue_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/issues/125","number":125,"state":"open","locked":false,"title":"[Reviewer: Alex] Refactors ActiveAlarmList into ObservedAlarms which keeps track of the most recent state (CLEARED or otherwise) an alarm was raised with","user":{"login":"AME2","id":15612723,"avatar_url":"https://avatars.githubusercontent.com/u/15612723?v=3","gravatar_id":"","url":"https://api.github.com/users/AME2","html_url":"https://github.com/AME2","followers_url":"https://api.github.com/users/AME2/followers","following_url":"https://api.github.com/users/AME2/following{/other_user}","gists_url":"https://api.github.com/users/AME2/gists{/gist_id}","starred_url":"https://api.github.com/users/AME2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AME2/subscriptions","organizations_url":"https://api.github.com/users/AME2/orgs","repos_url":"https://api.github.com/users/AME2/repos","events_url":"https://api.github.com/users/AME2/events{/privacy}","received_events_url":"https://api.github.com/users/AME2/received_events","type":"User","site_admin":false},"body":"I have also included a Unit Test that CLEARs an alarm without having raised it first to make sure the trap doesn't get filtered out.","created_at":"2016-03-02T13:35:16Z","updated_at":"2016-03-03T10:06:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"AME2","id":15612723,"avatar_url":"https://avatars.githubusercontent.com/u/15612723?v=3","gravatar_id":"","url":"https://api.github.com/users/AME2","html_url":"https://github.com/AME2","followers_url":"https://api.github.com/users/AME2/followers","following_url":"https://api.github.com/users/AME2/following{/other_user}","gists_url":"https://api.github.com/users/AME2/gists{/gist_id}","starred_url":"https://api.github.com/users/AME2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AME2/subscriptions","organizations_url":"https://api.github.com/users/AME2/orgs","repos_url":"https://api.github.com/users/AME2/repos","events_url":"https://api.github.com/users/AME2/events{/privacy}","received_events_url":"https://api.github.com/users/AME2/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/125/commits","review_comments_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/125/comments","review_comment_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/issues/125/comments","statuses_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/statuses/fc5d80e2f717bbdf1fea913aad8de8f51f9b8451","head":{"label":"Metaswitch:CleanResync","ref":"CleanResync","sha":"fc5d80e2f717bbdf1fea913aad8de8f51f9b8451","user":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"repo":{"id":13772926,"name":"clearwater-snmp-handlers","full_name":"Metaswitch/clearwater-snmp-handlers","owner":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Metaswitch/clearwater-snmp-handlers","description":"SNMP extension modules to provide stats for Clearwater nodes","fork":false,"url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers","forks_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/forks","keys_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/teams","hooks_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/hooks","issue_events_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/issues/events{/number}","events_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/events","assignees_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/assignees{/user}","branches_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/branches{/branch}","tags_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/tags","blobs_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/statuses/{sha}","languages_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/languages","stargazers_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/stargazers","contributors_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/contributors","subscribers_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/subscribers","subscription_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/subscription","commits_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/contents/{+path}","compare_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/merges","archive_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/downloads","issues_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/issues{/number}","pulls_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls{/number}","milestones_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/milestones{/number}","notifications_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/labels{/name}","releases_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/releases{/id}","deployments_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/deployments","created_at":"2013-10-22T12:45:34Z","updated_at":"2016-01-11T14:34:17Z","pushed_at":"2016-03-02T13:35:16Z","git_url":"git://github.com/Metaswitch/clearwater-snmp-handlers.git","ssh_url":"git@github.com:Metaswitch/clearwater-snmp-handlers.git","clone_url":"https://github.com/Metaswitch/clearwater-snmp-handlers.git","svn_url":"https://github.com/Metaswitch/clearwater-snmp-handlers","homepage":null,"size":550,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"Metaswitch:master","ref":"master","sha":"cb60e7dbdb00604f8d4218fc90f4a6c208576c82","user":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"repo":{"id":13772926,"name":"clearwater-snmp-handlers","full_name":"Metaswitch/clearwater-snmp-handlers","owner":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Metaswitch/clearwater-snmp-handlers","description":"SNMP extension modules to provide stats for Clearwater nodes","fork":false,"url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers","forks_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/forks","keys_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/teams","hooks_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/hooks","issue_events_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/issues/events{/number}","events_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/events","assignees_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/assignees{/user}","branches_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/branches{/branch}","tags_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/tags","blobs_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/statuses/{sha}","languages_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/languages","stargazers_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/stargazers","contributors_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/contributors","subscribers_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/subscribers","subscription_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/subscription","commits_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/contents/{+path}","compare_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/merges","archive_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/downloads","issues_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/issues{/number}","pulls_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls{/number}","milestones_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/milestones{/number}","notifications_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/labels{/name}","releases_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/releases{/id}","deployments_url":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/deployments","created_at":"2013-10-22T12:45:34Z","updated_at":"2016-01-11T14:34:17Z","pushed_at":"2016-03-02T13:35:16Z","git_url":"git://github.com/Metaswitch/clearwater-snmp-handlers.git","ssh_url":"git@github.com:Metaswitch/clearwater-snmp-handlers.git","clone_url":"https://github.com/Metaswitch/clearwater-snmp-handlers.git","svn_url":"https://github.com/Metaswitch/clearwater-snmp-handlers","homepage":null,"size":550,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/125"},"html":{"href":"https://github.com/Metaswitch/clearwater-snmp-handlers/pull/125"},"issue":{"href":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/issues/125"},"comments":{"href":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/Metaswitch/clearwater-snmp-handlers/statuses/fc5d80e2f717bbdf1fea913aad8de8f51f9b8451"}}}}