|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
Unified facade for all network_system integration bridges. More...
#include <network_system_bridge.h>

Classes | |
| class | Impl |
Public Member Functions | |
| NetworkSystemBridge () | |
| Default constructor. | |
| NetworkSystemBridge (std::shared_ptr< ThreadPoolBridge > thread_pool) | |
| Construct bridge with custom thread pool. | |
| ~NetworkSystemBridge () | |
| Destructor. | |
| NetworkSystemBridge (const NetworkSystemBridge &)=delete | |
| NetworkSystemBridge & | operator= (const NetworkSystemBridge &)=delete |
| NetworkSystemBridge (NetworkSystemBridge &&) noexcept | |
| NetworkSystemBridge & | operator= (NetworkSystemBridge &&) noexcept |
| VoidResult | initialize (const NetworkSystemBridgeConfig &config) |
| Initialize all configured bridges. | |
| VoidResult | shutdown () |
| Shutdown all bridges. | |
| bool | is_initialized () const |
| Check if the bridge is initialized. | |
| BridgeMetrics | get_metrics () const |
| Get aggregated metrics from all bridges. | |
| std::shared_ptr< ThreadPoolBridge > | get_thread_pool_bridge () const |
| Get thread pool bridge. | |
| std::shared_ptr< thread_pool_interface > | get_thread_pool () const |
| Get thread pool interface. | |
| std::shared_ptr< logger_interface > | get_logger () const |
| Get logger interface. | |
| std::shared_ptr< monitoring_interface > | get_monitoring () const |
| Get monitoring interface. | |
| VoidResult | set_thread_pool_bridge (std::shared_ptr< ThreadPoolBridge > bridge) |
| Set custom thread pool bridge. | |
| VoidResult | set_logger (std::shared_ptr< logger_interface > logger) |
| Set custom logger. | |
| VoidResult | set_monitoring (std::shared_ptr< monitoring_interface > monitoring) |
| Set custom monitoring. | |
Static Public Member Functions | |
| static std::shared_ptr< NetworkSystemBridge > | create_default () |
| Create bridge with default configuration. | |
| static std::shared_ptr< NetworkSystemBridge > | with_thread_system (const std::string &pool_name="network_pool") |
| Create bridge with thread_system integration. | |
| static std::shared_ptr< NetworkSystemBridge > | with_custom (std::shared_ptr< thread_pool_interface > thread_pool=nullptr, std::shared_ptr< logger_interface > logger=nullptr, std::shared_ptr< monitoring_interface > monitoring=nullptr) |
| Create bridge with custom components. | |
Private Attributes | |
| std::unique_ptr< Impl > | pimpl_ |
Unified facade for all network_system integration bridges.
This class provides a single entry point for managing all external system integrations in network_system. It consolidates thread pool, logger, and monitoring integrations into a unified interface.
Key Features:
Lifecycle:
Thread Safety:
Definition at line 149 of file network_system_bridge.h.
| kcenon::network::integration::NetworkSystemBridge::NetworkSystemBridge | ( | ) |
Default constructor.
Creates a bridge with default settings. All integrations are disabled until explicitly configured and initialized.
Definition at line 206 of file network_system_bridge.cpp.
|
explicit |
Construct bridge with custom thread pool.
| thread_pool | Thread pool bridge to use |
Creates a bridge with a specific thread pool bridge. Other integrations can be added via set_* methods.
Definition at line 210 of file network_system_bridge.cpp.
References pimpl_.
|
default |
Destructor.
Automatically calls shutdown() if initialized
|
delete |
|
defaultnoexcept |
|
static |
Create bridge with default configuration.
Creates a bridge with:
Example:
Definition at line 311 of file network_system_bridge.cpp.
References kcenon::network::integration::ThreadPoolBridge::from_thread_system().

| std::shared_ptr< logger_interface > kcenon::network::integration::NetworkSystemBridge::get_logger | ( | ) | const |
Get logger interface.
Definition at line 265 of file network_system_bridge.cpp.
References pimpl_.
| BridgeMetrics kcenon::network::integration::NetworkSystemBridge::get_metrics | ( | ) | const |
Get aggregated metrics from all bridges.
Returns combined metrics from all initialized bridges. Custom metrics from each bridge are prefixed with the bridge name.
Definition at line 244 of file network_system_bridge.cpp.
References pimpl_.
| std::shared_ptr< monitoring_interface > kcenon::network::integration::NetworkSystemBridge::get_monitoring | ( | ) | const |
Get monitoring interface.
Definition at line 272 of file network_system_bridge.cpp.
References pimpl_.
| std::shared_ptr< thread_pool_interface > kcenon::network::integration::NetworkSystemBridge::get_thread_pool | ( | ) | const |
Get thread pool interface.
Convenience method equivalent to:
Definition at line 258 of file network_system_bridge.cpp.
References pimpl_.
| std::shared_ptr< ThreadPoolBridge > kcenon::network::integration::NetworkSystemBridge::get_thread_pool_bridge | ( | ) | const |
Get thread pool bridge.
Definition at line 251 of file network_system_bridge.cpp.
References pimpl_.
| VoidResult kcenon::network::integration::NetworkSystemBridge::initialize | ( | const NetworkSystemBridgeConfig & | config | ) |
Initialize all configured bridges.
| config | Configuration for all bridges |
Initializes all enabled bridges according to the configuration. If any bridge fails to initialize, all previously initialized bridges are shut down and an error is returned.
Error Conditions:
Example:
Definition at line 220 of file network_system_bridge.cpp.
References config, kcenon::network::error_void(), and kcenon::network::error_codes::common_errors::not_initialized.

| bool kcenon::network::integration::NetworkSystemBridge::is_initialized | ( | ) | const |
Check if the bridge is initialized.
Definition at line 237 of file network_system_bridge.cpp.
References pimpl_.
|
delete |
|
defaultnoexcept |
| VoidResult kcenon::network::integration::NetworkSystemBridge::set_logger | ( | std::shared_ptr< logger_interface > | logger | ) |
Set custom logger.
| logger | Logger implementation to use |
Sets a custom logger. Must be called before initialize().
Definition at line 289 of file network_system_bridge.cpp.
References kcenon::network::error_void(), kcenon::network::error_codes::common_errors::not_initialized, and pimpl_.

| VoidResult kcenon::network::integration::NetworkSystemBridge::set_monitoring | ( | std::shared_ptr< monitoring_interface > | monitoring | ) |
Set custom monitoring.
| monitoring | Monitoring implementation to use |
Sets a custom monitoring implementation. Must be called before initialize().
Definition at line 299 of file network_system_bridge.cpp.
References kcenon::network::error_void(), kcenon::network::error_codes::common_errors::not_initialized, and pimpl_.

| VoidResult kcenon::network::integration::NetworkSystemBridge::set_thread_pool_bridge | ( | std::shared_ptr< ThreadPoolBridge > | bridge | ) |
Set custom thread pool bridge.
| bridge | Thread pool bridge to use |
Sets a custom thread pool bridge. Must be called before initialize().
Error Conditions:
Definition at line 279 of file network_system_bridge.cpp.
References kcenon::network::error_void(), kcenon::network::error_codes::common_errors::not_initialized, and pimpl_.

| VoidResult kcenon::network::integration::NetworkSystemBridge::shutdown | ( | ) |
Shutdown all bridges.
Shuts down all initialized bridges in reverse initialization order. This method is idempotent - multiple calls are safe.
Definition at line 230 of file network_system_bridge.cpp.
References kcenon::network::ok(), and pimpl_.

|
static |
Create bridge with custom components.
| thread_pool | Custom thread pool (optional) |
| logger | Custom logger (optional) |
| monitoring | Custom monitoring (optional) |
Creates a bridge with custom components.
Definition at line 365 of file network_system_bridge.cpp.
References kcenon::network::integration::ThreadPoolBridge::Custom.
|
static |
Create bridge with thread_system integration.
| pool_name | Thread pool name (default: "network_pool") |
Creates a bridge configured for thread_system integration.
Example:
Definition at line 323 of file network_system_bridge.cpp.
References kcenon::network::integration::ThreadPoolBridge::from_thread_system().

|
private |
Definition at line 379 of file network_system_bridge.h.
Referenced by get_logger(), get_metrics(), get_monitoring(), get_thread_pool(), get_thread_pool_bridge(), is_initialized(), NetworkSystemBridge(), set_logger(), set_monitoring(), set_thread_pool_bridge(), and shutdown().