From b766baf6f34df321e8eff9687cc2c17485da6fb4 Mon Sep 17 00:00:00 2001 From: Michael Jurkoic Date: Mon, 18 Mar 2024 20:20:36 -0500 Subject: Use smart pointers --- include/nostr.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/nostr.hpp b/include/nostr.hpp index 1a4e33c..51ea7cd 100644 --- a/include/nostr.hpp +++ b/include/nostr.hpp @@ -104,8 +104,13 @@ private: class NostrService { public: - NostrService(plog::IAppender* appender, client::IWebSocketClient* client); - NostrService(plog::IAppender* appender, client::IWebSocketClient* client, RelayList relays); + NostrService( + std::shared_ptr appender, + std::shared_ptr client); + NostrService( + std::shared_ptr appender, + std::shared_ptr client, + RelayList relays); ~NostrService(); RelayList defaultRelays() const; @@ -207,7 +212,7 @@ private: const int MAX_EVENTS_PER_SUBSCRIPTION = 128; ///< The WebSocket client used to communicate with relays. - client::IWebSocketClient* _client; + shared_ptr _client; ///< A mutex to protect the instance properties. std::mutex _propertyMutex; ///< The default set of Nostr relays to which the service will attempt to connect. -- cgit