{"action":"created","issue":{"url":"https://api.github.com/repos/opensim-org/opensim-core/issues/712","labels_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/712/labels{/name}","comments_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/712/comments","events_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/712/events","html_url":"https://github.com/opensim-org/opensim-core/pull/712","id":117937380,"number":712,"title":"[Don't merge this] Sketch of formatters and adapters for discussion.","user":{"login":"sherm1","id":4088016,"avatar_url":"https://avatars.githubusercontent.com/u/4088016?v=3","gravatar_id":"","url":"https://api.github.com/users/sherm1","html_url":"https://github.com/sherm1","followers_url":"https://api.github.com/users/sherm1/followers","following_url":"https://api.github.com/users/sherm1/following{/other_user}","gists_url":"https://api.github.com/users/sherm1/gists{/gist_id}","starred_url":"https://api.github.com/users/sherm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sherm1/subscriptions","organizations_url":"https://api.github.com/users/sherm1/orgs","repos_url":"https://api.github.com/users/sherm1/repos","events_url":"https://api.github.com/users/sherm1/events{/privacy}","received_events_url":"https://api.github.com/users/sherm1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":27,"created_at":"2015-11-20T00:06:13Z","updated_at":"2015-11-24T18:11:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/712","html_url":"https://github.com/opensim-org/opensim-core/pull/712","diff_url":"https://github.com/opensim-org/opensim-core/pull/712.diff","patch_url":"https://github.com/opensim-org/opensim-core/pull/712.patch"},"body":"@aseth1, @klshrinidhi: I took a crack at sketching the classes we discussed on the whiteboard. Came out a little differently than I thought. Basic structure looks like this, with two main class families:\r\n```\r\nDataStreamFormatter\r\n      TRCDataStreamFormatter\r\n      MotDataStreamFormatter\r\n          ...\r\n\r\nDataAdapter\r\n      StreamDataAdapter\r\n          StringDataAdapter\r\n      FileDataAdapter\r\n      (plus two helper classes)\r\n\r\nThere is also C3dFormatter which is just a standalone wrapper for BTK and is *not* a DataStreamFormatter. \r\n```\r\nTake a look at the header file associated with this PR. It is not compilable but should work for discussion in this PR. "},"comment":{"url":"https://api.github.com/repos/opensim-org/opensim-core/issues/comments/159359590","html_url":"https://github.com/opensim-org/opensim-core/pull/712#issuecomment-159359590","issue_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/712","id":159359590,"user":{"login":"sherm1","id":4088016,"avatar_url":"https://avatars.githubusercontent.com/u/4088016?v=3","gravatar_id":"","url":"https://api.github.com/users/sherm1","html_url":"https://github.com/sherm1","followers_url":"https://api.github.com/users/sherm1/followers","following_url":"https://api.github.com/users/sherm1/following{/other_user}","gists_url":"https://api.github.com/users/sherm1/gists{/gist_id}","starred_url":"https://api.github.com/users/sherm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sherm1/subscriptions","organizations_url":"https://api.github.com/users/sherm1/orgs","repos_url":"https://api.github.com/users/sherm1/repos","events_url":"https://api.github.com/users/sherm1/events{/privacy}","received_events_url":"https://api.github.com/users/sherm1/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T18:11:18Z","updated_at":"2015-11-24T18:11:18Z","body":"Hmmm ... it looks to me like `FileAdapter` is now a singleton class; its methods can be static. Its job is to figure out which formatter to use. It could also be the place we keep the registry of formatters. The base class for the formatters would have virtual methods and a registry, but there would be no need to clone the formatters either; they could also be singletons. I'll come by to see if I'm confused."}}