Repository navigation
Restructure the core library after NwcIO and RvtIO - #23
Merged
Merged
Conversation
The entry points (PlaDocument, BimxDocument, PlaFile, the new PlaReaderOptions) stay in PlaIO; the document types (FdbHeader, PlaBlock, ObjectDirectory, CompressedPool, PoolSubgroup, PlaStream) move to PlaIO.Model, as RvtIO.Model and NwcIO.Model organize their cores. PlaReaderOptions caps what the readers decode into memory: MaxGlobalStreamBytes (default: the most one in-memory stream can hold) bounds the decoded global stream and the window a mode-2 ReadPayload builds, MaxDecodedPoolBytes (512 MiB) bounds one decoded pool, and MaxCoverBytes (64 MiB) replaces the fixed .bimx cover limit. The mode-2 global-window decode moves out of PlaDocument into internal machinery, and PlaStream exposes SkippedBlocks - the false entries of the scan behind UnreliableFrom.
Review fixes: - Open(string) and Open(Stream, bool) keep their 0.1.0 signatures; the reader options come through added overloads Open(string, PlaReaderOptions?) and Open(Stream, bool, PlaReaderOptions?), so a binary built against 0.1.0 keeps finding its entry points. - PlaReaderOptions is immutable (init-only properties): Default cannot be mutated, so one reader never changes the limits of another. - A mode-2 ReadPayload now checks the requested block's declared size against MaxGlobalStreamBytes before its buffer is allocated; the cap is a property of the whole window, which the requested block joins. - The getting-started example gains the PlaIO.Model using.
Contributor
Author
|
All three points are fixed in 59fe117:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The core package follows the IOExtend reference layout, as requested ("сделай архитектуру ядра чистой, референсы RvtIO/NwcIO"):
PlaIO.Model: the document types (FdbHeader,PlaBlock+PlaBlockMode,ObjectDirectory+ObjectDirectoryRecord,CompressedPool,PoolSubgroup,PlaStream) move out of the root namespace intosrc/PlaIO/Model/, the wayRvtIO.ModelandNwcIO.Modelorganize their cores. The root keeps the entry points:PlaDocument,BimxDocument,PlaFile, and the newPlaReaderOptions. Breaking namespace change (0.x preview allows it; CHANGELOG notes it).PlaReaderOptions(withDefault, afterNwcReaderOptions): caps what the readers decode into memory —MaxGlobalStreamBytes(default:Array.MaxLength, the most one in-memory stream can hold) bounds the decoded global stream and the window a mode-2ReadPayloadbuilds. Until nowOpenStreamon a large file decoded with no bound (S-Office: ~588 MB).MaxDecodedPoolBytes(512 MiB) bounds one decoded pool.MaxCoverBytes(64 MiB) replaces the fixed.bimxcover limit;BimxDocument.Opentakes the options.InvalidDataExceptionnaming the cap, checked against the declared sizes before decoding, so a skipped false entry is never mistaken for a cap failure.Internal.GlobalStreamDecoder: the mode-2 global-window decode moves out ofPlaDocument(it was a document method plus two privates); the document keeps orchestration only.PlaStream.SkippedBlocks: the false entries of the scan behindUnreliableFrom, in file order.Deliberately not added: an
NwcDiagnostic-style diagnostics subsystem — the lazy container reading has no eager pass that would fill one; the honest signals stay on the types (SkippedBlocks, directory quality pairs,PoolSubgroup.Partial). It lands with element reading.Verification
SkippedBlocksin file order).public-api.md) and CHANGELOG updated; ADR-007 in the vault.PlaBlockMode.Lz("cannot be decoded" — mode 2 has decoded since Decode mode 2 (LZ) payloads #17).