Hub.hpp: friend Listener so it can call sharedMapper()

sharedMapper was made private in #6 but Listener::handleMessage (defined
later in the same header) still calls Hub::sharedMapper(). Any consumer
that actually instantiates the WebSocket Listener hit a private-access
compile error. Add `friend class Listener;` so Listener can reach the
shared ObjectMapper without exposing it publicly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Uwe Schuster 2026-04-29 16:04:45 +02:00
parent c6a2dba22b
commit 87bf3b6e56

View file

@ -66,10 +66,12 @@ struct SocketInfo {
* @endcode
*/
struct HubHousekeeper; // forward-declare for friend (#439)
class Listener; // forward-declare for friend (Listener calls Hub::sharedMapper)
class Hub
: public oatpp::websocket::ConnectionHandler::SocketInstanceListener {
friend struct HubHousekeeper;
friend class Listener;
public:
using WebSocket = oatpp::websocket::WebSocket;