{"action":"created","comment":{"url":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/comments/53491126","id":53491126,"diff_hunk":"@@ -74,12 +74,78 @@ class AlarmState\n   std::string _identifier;\n };\n \n+/// @class BaseAlarm\n+/// \n+/// Superclass for alarms that allows us to split different types of\n+/// alarms into subclasses. Those alarms which only have one possible raised\n+/// state will be constructed by subclass Alarm. Those alarms which have two or\n+/// more possible raised states will be constructed by subclass\n+/// MultiStateAlarm. \n+\n+class BaseAlarm\n+{\n+public:\n+  BaseAlarm(const std::string& issuer,\n+            const int index);\n+  \n+  /// Queues a request to generate an alarm state change corresponding to the\n+  /// CLEARED severity.\n+  virtual void clear();\n+\n+  /// Uses the _last_state_raised member variable to re-raise the latest state\n+  /// of the alarm.\n+  virtual void reraise_last_state();\n+\n+protected:\n+  const int _index;\n+  AlarmState _clear_state;\n+  \n+  /// Keeps track of whether the alarm is raised\n+  std::atomic<bool> _alarmed;","path":"include/alarm.h","position":35,"original_position":31,"commit_id":"80eaba5c5b98db59040f9121da75482155a88816","original_commit_id":"1a4b1f1498e2d6dcc5aba331d364aa93205107e4","user":{"login":"chris-elford-metaswitch","id":2103471,"avatar_url":"https://avatars.githubusercontent.com/u/2103471?v=3","gravatar_id":"","url":"https://api.github.com/users/chris-elford-metaswitch","html_url":"https://github.com/chris-elford-metaswitch","followers_url":"https://api.github.com/users/chris-elford-metaswitch/followers","following_url":"https://api.github.com/users/chris-elford-metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/chris-elford-metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-elford-metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-elford-metaswitch/subscriptions","organizations_url":"https://api.github.com/users/chris-elford-metaswitch/orgs","repos_url":"https://api.github.com/users/chris-elford-metaswitch/repos","events_url":"https://api.github.com/users/chris-elford-metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/chris-elford-metaswitch/received_events","type":"User","site_admin":false},"body":"Please address this comment.","created_at":"2016-02-19T17:33:35Z","updated_at":"2016-02-19T17:33:35Z","html_url":"https://github.com/Metaswitch/cpp-common/pull/456#discussion_r53491126","pull_request_url":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/456","_links":{"self":{"href":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/comments/53491126"},"html":{"href":"https://github.com/Metaswitch/cpp-common/pull/456#discussion_r53491126"},"pull_request":{"href":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/456"}}},"pull_request":{"url":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/456","id":59510278,"html_url":"https://github.com/Metaswitch/cpp-common/pull/456","diff_url":"https://github.com/Metaswitch/cpp-common/pull/456.diff","patch_url":"https://github.com/Metaswitch/cpp-common/pull/456.patch","issue_url":"https://api.github.com/repos/Metaswitch/cpp-common/issues/456","number":456,"state":"open","locked":false,"title":"[Reviewer: Chris] Resend status of alarms to alarm handler- cpp-common","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":"The main changes here involve changes made to the alarm class hierarchy and creating functions to reraise the alarms every 30 seconds.","created_at":"2016-02-16T15:53:35Z","updated_at":"2016-02-19T17:33:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"290d0c35e437970af22959cfadd926282ff878ff","assignee":{"login":"chris-elford-metaswitch","id":2103471,"avatar_url":"https://avatars.githubusercontent.com/u/2103471?v=3","gravatar_id":"","url":"https://api.github.com/users/chris-elford-metaswitch","html_url":"https://github.com/chris-elford-metaswitch","followers_url":"https://api.github.com/users/chris-elford-metaswitch/followers","following_url":"https://api.github.com/users/chris-elford-metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/chris-elford-metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-elford-metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-elford-metaswitch/subscriptions","organizations_url":"https://api.github.com/users/chris-elford-metaswitch/orgs","repos_url":"https://api.github.com/users/chris-elford-metaswitch/repos","events_url":"https://api.github.com/users/chris-elford-metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/chris-elford-metaswitch/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/456/commits","review_comments_url":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/456/comments","review_comment_url":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Metaswitch/cpp-common/issues/456/comments","statuses_url":"https://api.github.com/repos/Metaswitch/cpp-common/statuses/80eaba5c5b98db59040f9121da75482155a88816","head":{"label":"Metaswitch:ReraisingAlarms","ref":"ReraisingAlarms","sha":"80eaba5c5b98db59040f9121da75482155a88816","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":15284898,"name":"cpp-common","full_name":"Metaswitch/cpp-common","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/cpp-common","description":"Common C/C++ modules for Clearwater components","fork":false,"url":"https://api.github.com/repos/Metaswitch/cpp-common","forks_url":"https://api.github.com/repos/Metaswitch/cpp-common/forks","keys_url":"https://api.github.com/repos/Metaswitch/cpp-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metaswitch/cpp-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metaswitch/cpp-common/teams","hooks_url":"https://api.github.com/repos/Metaswitch/cpp-common/hooks","issue_events_url":"https://api.github.com/repos/Metaswitch/cpp-common/issues/events{/number}","events_url":"https://api.github.com/repos/Metaswitch/cpp-common/events","assignees_url":"https://api.github.com/repos/Metaswitch/cpp-common/assignees{/user}","branches_url":"https://api.github.com/repos/Metaswitch/cpp-common/branches{/branch}","tags_url":"https://api.github.com/repos/Metaswitch/cpp-common/tags","blobs_url":"https://api.github.com/repos/Metaswitch/cpp-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metaswitch/cpp-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metaswitch/cpp-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metaswitch/cpp-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metaswitch/cpp-common/statuses/{sha}","languages_url":"https://api.github.com/repos/Metaswitch/cpp-common/languages","stargazers_url":"https://api.github.com/repos/Metaswitch/cpp-common/stargazers","contributors_url":"https://api.github.com/repos/Metaswitch/cpp-common/contributors","subscribers_url":"https://api.github.com/repos/Metaswitch/cpp-common/subscribers","subscription_url":"https://api.github.com/repos/Metaswitch/cpp-common/subscription","commits_url":"https://api.github.com/repos/Metaswitch/cpp-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metaswitch/cpp-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metaswitch/cpp-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metaswitch/cpp-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metaswitch/cpp-common/contents/{+path}","compare_url":"https://api.github.com/repos/Metaswitch/cpp-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metaswitch/cpp-common/merges","archive_url":"https://api.github.com/repos/Metaswitch/cpp-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metaswitch/cpp-common/downloads","issues_url":"https://api.github.com/repos/Metaswitch/cpp-common/issues{/number}","pulls_url":"https://api.github.com/repos/Metaswitch/cpp-common/pulls{/number}","milestones_url":"https://api.github.com/repos/Metaswitch/cpp-common/milestones{/number}","notifications_url":"https://api.github.com/repos/Metaswitch/cpp-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metaswitch/cpp-common/labels{/name}","releases_url":"https://api.github.com/repos/Metaswitch/cpp-common/releases{/id}","deployments_url":"https://api.github.com/repos/Metaswitch/cpp-common/deployments","created_at":"2013-12-18T14:11:57Z","updated_at":"2016-01-11T14:34:27Z","pushed_at":"2016-02-19T16:52:36Z","git_url":"git://github.com/Metaswitch/cpp-common.git","ssh_url":"git@github.com:Metaswitch/cpp-common.git","clone_url":"https://github.com/Metaswitch/cpp-common.git","svn_url":"https://github.com/Metaswitch/cpp-common","homepage":null,"size":1962,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":15,"forks":6,"open_issues":15,"watchers":3,"default_branch":"master"}},"base":{"label":"Metaswitch:master","ref":"master","sha":"1e43e022f6b89d83289b43c494410c93e251641f","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":15284898,"name":"cpp-common","full_name":"Metaswitch/cpp-common","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/cpp-common","description":"Common C/C++ modules for Clearwater components","fork":false,"url":"https://api.github.com/repos/Metaswitch/cpp-common","forks_url":"https://api.github.com/repos/Metaswitch/cpp-common/forks","keys_url":"https://api.github.com/repos/Metaswitch/cpp-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metaswitch/cpp-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metaswitch/cpp-common/teams","hooks_url":"https://api.github.com/repos/Metaswitch/cpp-common/hooks","issue_events_url":"https://api.github.com/repos/Metaswitch/cpp-common/issues/events{/number}","events_url":"https://api.github.com/repos/Metaswitch/cpp-common/events","assignees_url":"https://api.github.com/repos/Metaswitch/cpp-common/assignees{/user}","branches_url":"https://api.github.com/repos/Metaswitch/cpp-common/branches{/branch}","tags_url":"https://api.github.com/repos/Metaswitch/cpp-common/tags","blobs_url":"https://api.github.com/repos/Metaswitch/cpp-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metaswitch/cpp-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metaswitch/cpp-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metaswitch/cpp-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metaswitch/cpp-common/statuses/{sha}","languages_url":"https://api.github.com/repos/Metaswitch/cpp-common/languages","stargazers_url":"https://api.github.com/repos/Metaswitch/cpp-common/stargazers","contributors_url":"https://api.github.com/repos/Metaswitch/cpp-common/contributors","subscribers_url":"https://api.github.com/repos/Metaswitch/cpp-common/subscribers","subscription_url":"https://api.github.com/repos/Metaswitch/cpp-common/subscription","commits_url":"https://api.github.com/repos/Metaswitch/cpp-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metaswitch/cpp-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metaswitch/cpp-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metaswitch/cpp-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metaswitch/cpp-common/contents/{+path}","compare_url":"https://api.github.com/repos/Metaswitch/cpp-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metaswitch/cpp-common/merges","archive_url":"https://api.github.com/repos/Metaswitch/cpp-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metaswitch/cpp-common/downloads","issues_url":"https://api.github.com/repos/Metaswitch/cpp-common/issues{/number}","pulls_url":"https://api.github.com/repos/Metaswitch/cpp-common/pulls{/number}","milestones_url":"https://api.github.com/repos/Metaswitch/cpp-common/milestones{/number}","notifications_url":"https://api.github.com/repos/Metaswitch/cpp-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metaswitch/cpp-common/labels{/name}","releases_url":"https://api.github.com/repos/Metaswitch/cpp-common/releases{/id}","deployments_url":"https://api.github.com/repos/Metaswitch/cpp-common/deployments","created_at":"2013-12-18T14:11:57Z","updated_at":"2016-01-11T14:34:27Z","pushed_at":"2016-02-19T16:52:36Z","git_url":"git://github.com/Metaswitch/cpp-common.git","ssh_url":"git@github.com:Metaswitch/cpp-common.git","clone_url":"https://github.com/Metaswitch/cpp-common.git","svn_url":"https://github.com/Metaswitch/cpp-common","homepage":null,"size":1962,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":15,"forks":6,"open_issues":15,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/456"},"html":{"href":"https://github.com/Metaswitch/cpp-common/pull/456"},"issue":{"href":"https://api.github.com/repos/Metaswitch/cpp-common/issues/456"},"comments":{"href":"https://api.github.com/repos/Metaswitch/cpp-common/issues/456/comments"},"review_comments":{"href":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/456/comments"},"review_comment":{"href":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Metaswitch/cpp-common/pulls/456/commits"},"statuses":{"href":"https://api.github.com/repos/Metaswitch/cpp-common/statuses/80eaba5c5b98db59040f9121da75482155a88816"}}}}