-
Notifications
You must be signed in to change notification settings - Fork 55
Add InputStreamBase: common base class of InputBinaryStream and InputTextStream #1426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add InputStreamBase: common base class of InputBinaryStream and InputTextStream #1426
Conversation
e3813ec
to
6277983
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new base class InputStreamBase
to provide common functionality for InputBinaryStream
and InputTextStream
classes, reducing code duplication and improving maintainability. The refactoring consolidates shared stream management logic into the base class while maintaining the same public API.
Key changes:
- Created
InputStreamBase
as a common base class with shared stream management functionality - Refactored
InputTextStream
andInputBinaryStream
to inherit from the base class - Consolidated the
lexical_cast
function implementation into the base class
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
include/itkInputStreamBase.h |
New base class containing common stream management methods and member variables |
include/itkInputTextStream.h |
Refactored to inherit from InputStreamBase , removing duplicated code |
include/itkInputBinaryStream.h |
Refactored to inherit from InputStreamBase , removing duplicated code |
src/itkInputStreamBase.cxx |
Updated to implement lexical_cast for the base class instead of text stream |
src/itkInputBinaryStream.cxx |
Removed file as functionality moved to base class |
src/CMakeLists.txt |
Updated build configuration to include base class and remove binary stream source |
4f2ba74
to
3a08ecd
Compare
Paved the way to share its source code with InputBinaryStream.
Very much reduces the amount of duplicate code. Adds the ability to call `GetPointer()` on an InputBinaryStream, just like it was already supported on an InputTextStream.
3a08ecd
to
6aac66e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@N-Dekker thanks!
One issue noted inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Niels!
Follow-up to pull request InsightSoftwareConsortium#1426 commit b737cf4 "feat: Add InputStreamBase, base class of InputTextStream"
Follow-up to pull request InsightSoftwareConsortium#1426 commit 6aac66e "feat: Let InputBinaryStream inherit from InputStreamBase"
Follow-up to pull request InsightSoftwareConsortium#1426 commit 6aac66e "feat: Let InputBinaryStream inherit from InputStreamBase"
Aims to share the common source code between InputBinaryStream and InputTextStream.