Consolidate buffering layer - C++20 Module preparation (#309)#314
Merged
Conversation
- Extract calculate_percentile to detail namespace for reuse - Extract ring_buffer_index helper for consistent buffer indexing - Extract calculate_basic_statistics for common statistics computation - Refactor time_series_buffer to use detail utilities - Refactor load_average_history to use detail utilities This reduces code duplication between time_series_buffer and load_average_history classes, following Kent Beck's "No Duplication" principle as part of C++20 module preparation. Part of #309
Update architecture documentation to distinguish between: - Public API: time_series_buffer, thread_local_buffer - Internal API (@internal): buffer_manager, ring_buffer, buffering_strategy Also add src/utils internal files to PROJECT_STRUCTURE.md to document the internal buffer implementation layer. Part of #309
Owner
Author
CI Status NoteThe Windows MSVC build failure is unrelated to this PR. The error is: This is a pre-existing issue in Summary of CI Results
The Windows issue should be tracked separately and is not related to the buffering layer consolidation work. |
… member methods Replace deprecated kcenon::common helper functions with Result member methods to fix MSVC build warning treated as error (C4996): - is_error(result) -> result.is_err() - is_ok(result) -> result.is_ok() - get_value(result) -> result.value() - get_error(result) -> result.error() Affected files: - thread_system_adapter.h - common_monitor_adapter.h - common_system_adapter.h
Update examples to use Result member methods instead of deprecated helper functions for consistency with the codebase: - result.is_ok() instead of is_ok(result) - result.is_err() instead of is_error(result) - result.value() instead of get_value(result) - result.error() instead of get_error(result) Also fix bool conversion: if(result) -> if(result.is_ok())
Document the deprecated common_system helper function replacement that fixes the MSVC build error (C4996 warning treated as error).
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
* refactor(utils): extract common buffer utilities to detail namespace - Extract calculate_percentile to detail namespace for reuse - Extract ring_buffer_index helper for consistent buffer indexing - Extract calculate_basic_statistics for common statistics computation - Refactor time_series_buffer to use detail utilities - Refactor load_average_history to use detail utilities This reduces code duplication between time_series_buffer and load_average_history classes, following Kent Beck's "No Duplication" principle as part of C++20 module preparation. Part of #309 * docs(utils): mark internal buffer APIs with @internal tag Add @internal doxygen tags to internal buffer implementation files: - ring_buffer.h - buffering_strategy.h - buffer_manager.h This clarifies the public vs internal API boundary for C++20 module preparation and helps developers understand which APIs are stable. Part of #309 * docs: clarify public vs internal buffer APIs Update architecture documentation to distinguish between: - Public API: time_series_buffer, thread_local_buffer - Internal API (@internal): buffer_manager, ring_buffer, buffering_strategy Also add src/utils internal files to PROJECT_STRUCTURE.md to document the internal buffer implementation layer. Part of #309 * fix(adapters): replace deprecated common_system helper functions with member methods Replace deprecated kcenon::common helper functions with Result member methods to fix MSVC build warning treated as error (C4996): - is_error(result) -> result.is_err() - is_ok(result) -> result.is_ok() - get_value(result) -> result.value() - get_error(result) -> result.error() Affected files: - thread_system_adapter.h - common_monitor_adapter.h - common_system_adapter.h * refactor(examples): update Result pattern usage to modern API Update examples to use Result member methods instead of deprecated helper functions for consistency with the codebase: - result.is_ok() instead of is_ok(result) - result.is_err() instead of is_error(result) - result.value() instead of get_value(result) - result.error() instead of get_error(result) Also fix bool conversion: if(result) -> if(result.is_ok()) * docs(changelog): add MSVC build fix entry Document the deprecated common_system helper function replacement that fixes the MSVC build error (C4996 warning treated as error).
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.
Summary
detailnamespace for code reuse@internaldoxygen tagsChanges
1. Common Utilities Extraction (
time_series_buffer.h)detail::calculate_percentile(): Shared percentile calculationdetail::ring_buffer_index(): Common ring buffer indexing logicdetail::calculate_basic_statistics(): Unified statistics computationtime_series_buffer<T>andload_average_historynow use these utilities2. Internal API Markers
Added
@internaldoxygen tags to mark implementation details:src/utils/ring_buffer.hsrc/utils/buffering_strategy.hsrc/utils/buffer_manager.h3. Documentation Updates
ARCHITECTURE.md/ARCHITECTURE_KO.md: Distinguish Public vs Internal APIsPROJECT_STRUCTURE.md: Documentsrc/utils/internal filesSub-Issues Created
This PR creates the foundation for further consolidation work:
Test Plan
Related
Closes #309
Part of C++20 Module Migration Epic (kcenon/common_system#256)