{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/facter/pulls/comments/37593709","id":37593709,"diff_hunk":"@@ -0,0 +1,263 @@\n+#include <odmi.h>\n+\n+#include <cstdint>\n+#include <memory>\n+#include <string>\n+\n+namespace facter { namespace util { namespace aix {\n+\n+    // This is a singleton class that handles initialization and\n+    // termination of the ODM library. As long as any other class holds a\n+    // reference to this one, ODM will remain initialized.\n+    //\n+    // This class also provides static helpers for interacting with the ODM\n+    class odm {\n+    public:\n+         typedef std::shared_ptr<odm> ptr;\n+         static ptr get() {\n+             static std::weak_ptr<odm> self;","path":"lib/inc/internal/util/aix/odm.hpp","position":18,"original_position":18,"commit_id":"3f03683926ad877ecd8f2b7a7e9d7a7a20fe8991","original_commit_id":"3f03683926ad877ecd8f2b7a7e9d7a7a20fe8991","user":{"login":"branan","id":37594,"avatar_url":"https://avatars.githubusercontent.com/u/37594?v=3","gravatar_id":"","url":"https://api.github.com/users/branan","html_url":"https://github.com/branan","followers_url":"https://api.github.com/users/branan/followers","following_url":"https://api.github.com/users/branan/following{/other_user}","gists_url":"https://api.github.com/users/branan/gists{/gist_id}","starred_url":"https://api.github.com/users/branan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branan/subscriptions","organizations_url":"https://api.github.com/users/branan/orgs","repos_url":"https://api.github.com/users/branan/repos","events_url":"https://api.github.com/users/branan/events{/privacy}","received_events_url":"https://api.github.com/users/branan/received_events","type":"User","site_admin":false},"body":"It's not thread-safe in this form, because I don't have std::mutex on AIX and didn't want to mess with low-level locking primitives. With a bit of cleanup we could probably turn it into a mixin (ala `enable_shared_from_this`) - something like `class my_thing : public lazy_shared_singleton<my_thing>`","created_at":"2015-08-20T23:43:23Z","updated_at":"2015-08-20T23:43:23Z","html_url":"https://github.com/puppetlabs/facter/pull/1115#discussion_r37593709","pull_request_url":"https://api.github.com/repos/puppetlabs/facter/pulls/1115","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/comments/37593709"},"html":{"href":"https://github.com/puppetlabs/facter/pull/1115#discussion_r37593709"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/1115"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/facter/pulls/1115","id":42980442,"html_url":"https://github.com/puppetlabs/facter/pull/1115","diff_url":"https://github.com/puppetlabs/facter/pull/1115.diff","patch_url":"https://github.com/puppetlabs/facter/pull/1115.patch","issue_url":"https://api.github.com/repos/puppetlabs/facter/issues/1115","number":1115,"state":"open","locked":false,"title":"(DO NOT MERGE) (RFC) Implement a C++ wrapper around the AIX ODM iteration API","user":{"login":"branan","id":37594,"avatar_url":"https://avatars.githubusercontent.com/u/37594?v=3","gravatar_id":"","url":"https://api.github.com/users/branan","html_url":"https://github.com/branan","followers_url":"https://api.github.com/users/branan/followers","following_url":"https://api.github.com/users/branan/following{/other_user}","gists_url":"https://api.github.com/users/branan/gists{/gist_id}","starred_url":"https://api.github.com/users/branan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branan/subscriptions","organizations_url":"https://api.github.com/users/branan/orgs","repos_url":"https://api.github.com/users/branan/repos","events_url":"https://api.github.com/users/branan/events{/privacy}","received_events_url":"https://api.github.com/users/branan/received_events","type":"User","site_admin":false},"body":"This is a wrapper around the low-level querying and iteration of the AIX ODM API. Further wrappers could be built on top of this to wrap the concepts used in higher-level groups of class (for example, the {Predefined,Custom}{Device,Attribute} tables used in the configuration system)\r\n\r\nThis attempts to enforce the rules required by the ODM API itself, but unfortunately is not thread-safe, since std::mutex does not appear to be implemented for AIX in GCC 4.8\r\n\r\nThe examples directory is added just so I had a good place to dump an example of how this is intended to be used.","created_at":"2015-08-20T21:26:47Z","updated_at":"2015-08-20T23:43:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4a4918bdbcdc15be57c3f8d4a03dd65d55c591a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/facter/pulls/1115/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/facter/pulls/1115/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/facter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/facter/issues/1115/comments","statuses_url":"https://api.github.com/repos/puppetlabs/facter/statuses/3f03683926ad877ecd8f2b7a7e9d7a7a20fe8991","head":{"label":"branan:rfc/master/odm-wrapper","ref":"rfc/master/odm-wrapper","sha":"3f03683926ad877ecd8f2b7a7e9d7a7a20fe8991","user":{"login":"branan","id":37594,"avatar_url":"https://avatars.githubusercontent.com/u/37594?v=3","gravatar_id":"","url":"https://api.github.com/users/branan","html_url":"https://github.com/branan","followers_url":"https://api.github.com/users/branan/followers","following_url":"https://api.github.com/users/branan/following{/other_user}","gists_url":"https://api.github.com/users/branan/gists{/gist_id}","starred_url":"https://api.github.com/users/branan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branan/subscriptions","organizations_url":"https://api.github.com/users/branan/orgs","repos_url":"https://api.github.com/users/branan/repos","events_url":"https://api.github.com/users/branan/events{/privacy}","received_events_url":"https://api.github.com/users/branan/received_events","type":"User","site_admin":false},"repo":{"id":14342682,"name":"facter","full_name":"branan/facter","owner":{"login":"branan","id":37594,"avatar_url":"https://avatars.githubusercontent.com/u/37594?v=3","gravatar_id":"","url":"https://api.github.com/users/branan","html_url":"https://github.com/branan","followers_url":"https://api.github.com/users/branan/followers","following_url":"https://api.github.com/users/branan/following{/other_user}","gists_url":"https://api.github.com/users/branan/gists{/gist_id}","starred_url":"https://api.github.com/users/branan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branan/subscriptions","organizations_url":"https://api.github.com/users/branan/orgs","repos_url":"https://api.github.com/users/branan/repos","events_url":"https://api.github.com/users/branan/events{/privacy}","received_events_url":"https://api.github.com/users/branan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/branan/facter","description":"","fork":true,"url":"https://api.github.com/repos/branan/facter","forks_url":"https://api.github.com/repos/branan/facter/forks","keys_url":"https://api.github.com/repos/branan/facter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/branan/facter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/branan/facter/teams","hooks_url":"https://api.github.com/repos/branan/facter/hooks","issue_events_url":"https://api.github.com/repos/branan/facter/issues/events{/number}","events_url":"https://api.github.com/repos/branan/facter/events","assignees_url":"https://api.github.com/repos/branan/facter/assignees{/user}","branches_url":"https://api.github.com/repos/branan/facter/branches{/branch}","tags_url":"https://api.github.com/repos/branan/facter/tags","blobs_url":"https://api.github.com/repos/branan/facter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/branan/facter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/branan/facter/git/refs{/sha}","trees_url":"https://api.github.com/repos/branan/facter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/branan/facter/statuses/{sha}","languages_url":"https://api.github.com/repos/branan/facter/languages","stargazers_url":"https://api.github.com/repos/branan/facter/stargazers","contributors_url":"https://api.github.com/repos/branan/facter/contributors","subscribers_url":"https://api.github.com/repos/branan/facter/subscribers","subscription_url":"https://api.github.com/repos/branan/facter/subscription","commits_url":"https://api.github.com/repos/branan/facter/commits{/sha}","git_commits_url":"https://api.github.com/repos/branan/facter/git/commits{/sha}","comments_url":"https://api.github.com/repos/branan/facter/comments{/number}","issue_comment_url":"https://api.github.com/repos/branan/facter/issues/comments{/number}","contents_url":"https://api.github.com/repos/branan/facter/contents/{+path}","compare_url":"https://api.github.com/repos/branan/facter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/branan/facter/merges","archive_url":"https://api.github.com/repos/branan/facter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/branan/facter/downloads","issues_url":"https://api.github.com/repos/branan/facter/issues{/number}","pulls_url":"https://api.github.com/repos/branan/facter/pulls{/number}","milestones_url":"https://api.github.com/repos/branan/facter/milestones{/number}","notifications_url":"https://api.github.com/repos/branan/facter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/branan/facter/labels{/name}","releases_url":"https://api.github.com/repos/branan/facter/releases{/id}","created_at":"2013-11-12T19:25:37Z","updated_at":"2014-06-11T18:23:05Z","pushed_at":"2015-08-20T21:24:39Z","git_url":"git://github.com/branan/facter.git","ssh_url":"git@github.com:branan/facter.git","clone_url":"https://github.com/branan/facter.git","svn_url":"https://github.com/branan/facter","homepage":"http://projects.puppetlabs.com/projects/facter","size":11711,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"83a69dd3d7c4e8a57fcafdfb0ffa5de6ad8ed5e4","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":910757,"name":"facter","full_name":"puppetlabs/facter","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/facter","description":"Collect and display system facts","fork":false,"url":"https://api.github.com/repos/puppetlabs/facter","forks_url":"https://api.github.com/repos/puppetlabs/facter/forks","keys_url":"https://api.github.com/repos/puppetlabs/facter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/facter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/facter/teams","hooks_url":"https://api.github.com/repos/puppetlabs/facter/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/facter/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/facter/events","assignees_url":"https://api.github.com/repos/puppetlabs/facter/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/facter/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/facter/tags","blobs_url":"https://api.github.com/repos/puppetlabs/facter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/facter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/facter/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/facter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/facter/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/facter/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/facter/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/facter/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/facter/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/facter/subscription","commits_url":"https://api.github.com/repos/puppetlabs/facter/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/facter/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/facter/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/facter/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/facter/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/facter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/facter/merges","archive_url":"https://api.github.com/repos/puppetlabs/facter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/facter/downloads","issues_url":"https://api.github.com/repos/puppetlabs/facter/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/facter/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/facter/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/facter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/facter/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/facter/releases{/id}","created_at":"2010-09-14T19:31:04Z","updated_at":"2015-08-06T03:34:49Z","pushed_at":"2015-08-20T23:36:33Z","git_url":"git://github.com/puppetlabs/facter.git","ssh_url":"git@github.com:puppetlabs/facter.git","clone_url":"https://github.com/puppetlabs/facter.git","svn_url":"https://github.com/puppetlabs/facter","homepage":"https://tickets.puppetlabs.com/browse/FACT","size":22104,"stargazers_count":385,"watchers_count":385,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":366,"mirror_url":null,"open_issues_count":5,"forks":366,"open_issues":5,"watchers":385,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/1115"},"html":{"href":"https://github.com/puppetlabs/facter/pull/1115"},"issue":{"href":"https://api.github.com/repos/puppetlabs/facter/issues/1115"},"comments":{"href":"https://api.github.com/repos/puppetlabs/facter/issues/1115/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/1115/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/1115/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/facter/statuses/3f03683926ad877ecd8f2b7a7e9d7a7a20fe8991"}}}}