refactor(adapters): consolidate adapter utilities into unified template#301
Merged
Conversation
- Add adapter<T> template with adapter_traits for value/smart pointer wrapping - Add interface_adapter<I, T> template for interface adaptation with depth tracking - Add adapter_factory for zero-cost adapter creation - Add comprehensive tests for all adapter functionality - Mark typed_adapter and smart_adapter as legacy with migration notes - Maintain full backward compatibility with existing API
21 tasks
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
…te (#301) - Add adapter<T> template with adapter_traits for value/smart pointer wrapping - Add interface_adapter<I, T> template for interface adaptation with depth tracking - Add adapter_factory for zero-cost adapter creation - Add comprehensive tests for all adapter functionality - Mark typed_adapter and smart_adapter as legacy with migration notes - Maintain full backward compatibility with existing API
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.
Closes #299
Summary
typed_adapter,smart_adapter) into a unified generic adapter systemadapter<T>template withadapter_traitsfor wrapping values,shared_ptr, andunique_ptrinterface_adapter<Interface, Implementation>for interface adaptation with depth trackingadapter_factoryclass for zero-cost adapter creation when implementation already implements interfaceChanges
New Files
include/kcenon/common/adapters/adapter.h: Unified adapter implementationtests/adapter_test.cpp: Comprehensive tests (31 test cases)Modified Files
include/kcenon/common/adapters/adapters.h: Updated to include new adapter, added migration guideinclude/kcenon/common/adapters/typed_adapter.h: Added deprecation notes and migration documentationinclude/kcenon/common/adapters/smart_adapter.h: Added deprecation notes and migration documentationtests/CMakeLists.txt: Added new adapter test targetMigration Guide
Test Plan