Conversation
1fdfd33 to
0705167
Compare
0705167 to
f124112
Compare
|
Performance testing showed that the slow |
2a67762 to
dfe851e
Compare
00e8974 to
d6fdb7f
Compare
nwhitehorn
left a comment
There was a problem hiding this comment.
This looks good to me from an architectural perspective. I'm not 100% I understand the rationale for the file-extension arguments, but that's a minor quibble. Thanks!
ae35aa4 to
5d4a1d4
Compare
5d4a1d4 to
e8c76e1
Compare
Handle fstream construction/destruction in streambuf classes. This also avoids the need for storing pointers in the pword() array.
destroyed, so dynamic casting will not work, and rdbuf() is not a public member of std::ios_base. The solution is to store a copy of the streambuf pointer in the pword() array, and clear it using ios_base functions.
6959569 to
a6dea50
Compare
cnweaver
left a comment
There was a problem hiding this comment.
As a general correctness issue, I don't see any calls to ios::xalloc, but it is a precondition that ios::pword can only be called with index values previously returned by xalloc. (I think the point here is that any user code is allowed to use pword and iword to attach things to ios_base, so each distinct use should call xalloc to ensure that it is using a unique index to do so. Hard-coding it to zero everywhere is unsafe, because it can conflict with any other (rare) code using this feature. It looks like there should be central bit of code that calls xalloc once, either the first time the index is needed, or on startup, and caches the value it gets in a variable which every function calling pword should read to get the index to use.
Implementation by CW, renamed some variables to avoid namespace collisions.
Implement file IO functions using STL constructs.
A set of stream buffer classes are defined in the private
streams.hheader. API functions in the publicdataio.hheader are significantly reduced, relying on the stream buffers to provide the backend implementation for flush, seek, tell, etc. The callback registration API is used to ensure destruction of instantiated stream buffers.The compression implementation here is API-compatible with the boost variant, verified by writing files with this branch and reading files with the master branch, and vice versa. These compression streambuf classes could straightforwardly be used in other applications, for example to implement the hybrid bzip2/flac compression scheme used in G3SuperTimestreams.
Seek/tell efficiency of the reader is maintained, although slightly reimplemented here with a caching counter.
New features:
Fixes #185.