Skip to content

Commit 23a9539

Browse files
authored
fix(session): replace internal header include with forward declaration (#943)
messaging_session.h included internal/tcp/tcp_socket.h which is not installed by cmake. External consumers (e.g., pacs_system) that transitively include this header get a fatal compilation error. Replace with a forward declaration of kcenon::network::internal::tcp_socket since the header only uses std::shared_ptr<tcp_socket> as a member type. Move the actual include to messaging_session.cpp where the full type is needed. Closes #942
1 parent 93bc564 commit 23a9539

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

include/kcenon/network/detail/session/messaging_session.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
#include <asio.hpp>
3333

3434
#include "kcenon/network/interfaces/i_session.h"
35-
#include "internal/tcp/tcp_socket.h"
35+
36+
namespace kcenon::network::internal
37+
{
38+
class tcp_socket;
39+
}
3640

3741
// Use nested namespace definition in C++17
3842
namespace kcenon::network::session

src/session/messaging_session.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <span>
88

9+
#include "internal/tcp/tcp_socket.h"
910
#include "internal/integration/logger_integration.h"
1011
#include "kcenon/network/detail/metrics/network_metrics.h"
1112

0 commit comments

Comments
 (0)