|
Common System 0.2.0
Common interfaces and patterns for system integration
|
Classes | |
| class | adapter |
| Unified adapter template for wrapping values or smart pointers. More... | |
| class | adapter_base |
| Base class for adapter interface to eliminate RTTI dependency. More... | |
| class | adapter_factory |
| Smart adapter factory that avoids unnecessary wrapping. More... | |
| struct | adapter_traits |
| Primary adapter_traits template for value types. More... | |
| struct | adapter_traits< std::shared_ptr< T > > |
| Specialization for std::shared_ptr. More... | |
| struct | adapter_traits< std::unique_ptr< T, Deleter > > |
| Specialization for std::unique_ptr. More... | |
| class | interface_adapter |
| Interface adapter with type safety and depth tracking. More... | |
| class | smart_adapter_factory |
| Smart adapter factory that avoids unnecessary wrapping. More... | |
Functions | |
| template<typename T > | |
| adapter (T) -> adapter< T > | |
| template<typename T > | |
| adapter (std::shared_ptr< T >) -> adapter< std::shared_ptr< T > > | |
| template<typename T , typename D > | |
| adapter (std::unique_ptr< T, D >) -> adapter< std::unique_ptr< T, D > > | |
| template<typename T , typename... Args> | |
| auto | make_adapter (Args &&... args) |
| Factory function to create adapter with in-place construction. | |
| template<typename T , typename... Args> | |
| auto | make_shared_adapter (Args &&... args) |
| Factory function to create adapter wrapping shared_ptr. | |
| template<typename T , typename... Args> | |
| auto | make_unique_adapter (Args &&... args) |
| Factory function to create adapter wrapping unique_ptr. | |
| template<typename T , typename Interface > | |
| std::shared_ptr< T > | safe_unwrap (std::shared_ptr< Interface > ptr) |
| Helper function to safely unwrap an adapter. | |
| template<typename Interface > | |
| bool | is_adapter (std::shared_ptr< Interface > ptr) |
| Check if an interface pointer is actually an adapter. | |
| template<typename Interface , typename Impl > | |
| std::shared_ptr< Interface > | make_interface_adapter (std::shared_ptr< Impl > impl) |
| Convenience function for creating smart adapters. | |
| template<typename T , typename Interface > | |
| std::shared_ptr< T > | unwrap_adapter (std::shared_ptr< Interface > ptr) |
| Convenience function for unwrapping adapters. | |
| template<typename Interface , typename Impl > | |
| std::shared_ptr< Interface > | make_smart_adapter (std::shared_ptr< Impl > impl) |
| Convenience function for creating smart adapters. | |
Variables | |
| template<typename T , typename Interface > | |
| constexpr bool | implements_interface_v |
| Type trait to check if a type implements an interface. | |
| kcenon::common::adapters::adapter | ( | std::shared_ptr< T > | ) | -> adapter< std::shared_ptr< T > > |
| kcenon::common::adapters::adapter | ( | std::unique_ptr< T, D > | ) | -> adapter< std::unique_ptr< T, D > > |
| kcenon::common::adapters::adapter | ( | T | ) | -> adapter< T > |
Referenced by main(), make_adapter(), make_shared_adapter(), and make_unique_adapter().

| bool kcenon::common::adapters::is_adapter | ( | std::shared_ptr< Interface > | ptr | ) |
Check if an interface pointer is actually an adapter.
| Interface | The interface type |
| ptr | Shared pointer to check |
Definition at line 541 of file adapter.h.
| auto kcenon::common::adapters::make_adapter | ( | Args &&... | args | ) |
Factory function to create adapter with in-place construction.
| T | The type to construct |
| Args | Constructor argument types |
| args | Arguments to forward to T's constructor |
Definition at line 263 of file adapter.h.
References adapter().

| std::shared_ptr< Interface > kcenon::common::adapters::make_interface_adapter | ( | std::shared_ptr< Impl > | impl | ) |
Convenience function for creating smart adapters.
| Interface | The target interface type |
| Impl | The implementation type (deduced) |
| impl | Shared pointer to implementation |
Definition at line 563 of file adapter.h.
References kcenon::common::adapters::adapter_factory::create().

| auto kcenon::common::adapters::make_shared_adapter | ( | Args &&... | args | ) |
Factory function to create adapter wrapping shared_ptr.
| T | The type to manage |
| Args | Constructor argument types |
| args | Arguments to forward to T's constructor |
Definition at line 276 of file adapter.h.
References adapter().
Referenced by main().


| std::shared_ptr< Interface > kcenon::common::adapters::make_smart_adapter | ( | std::shared_ptr< Impl > | impl | ) |
Convenience function for creating smart adapters.
| Interface | The target interface type |
| Impl | The implementation type (deduced) |
| impl | Shared pointer to implementation |
Definition at line 140 of file smart_adapter.h.
References kcenon::common::adapters::smart_adapter_factory::make_adapter().

| auto kcenon::common::adapters::make_unique_adapter | ( | Args &&... | args | ) |
Factory function to create adapter wrapping unique_ptr.
| T | The type to manage |
| Args | Constructor argument types |
| args | Arguments to forward to T's constructor |
Definition at line 289 of file adapter.h.
References adapter().

| std::shared_ptr< T > kcenon::common::adapters::safe_unwrap | ( | std::shared_ptr< Interface > | ptr | ) |
Helper function to safely unwrap an adapter.
| T | The expected underlying type |
| Interface | The interface type |
| ptr | Shared pointer to the interface |
Definition at line 530 of file adapter.h.
References kcenon::common::adapters::adapter_factory::try_unwrap().
Referenced by kcenon::common::adapters::smart_adapter_factory::try_unwrap().


| std::shared_ptr< T > kcenon::common::adapters::unwrap_adapter | ( | std::shared_ptr< Interface > | ptr | ) |
Convenience function for unwrapping adapters.
| T | The expected underlying type |
| Interface | The interface type (deduced) |
| ptr | Shared pointer to interface |
| T | The expected underlying type |
| Interface | The interface type (deduced) |
| ptr | Shared pointer to interface |
Definition at line 576 of file adapter.h.
References kcenon::common::adapters::adapter_factory::try_unwrap().

|
inlineconstexpr |
Type trait to check if a type implements an interface.
Type trait to check if a type implements an interface (C++17 compatible)
| T | The type to check |
| Interface | The interface to check against |
Definition at line 429 of file adapter.h.
Referenced by kcenon::common::adapters::adapter_factory::create(), kcenon::common::adapters::adapter_factory::is_zero_cost(), kcenon::common::adapters::smart_adapter_factory::is_zero_cost(), and kcenon::common::adapters::smart_adapter_factory::make_adapter().