diff options
author | Florent Le Coz <louiz@louiz.org> | 2015-12-21 20:45:40 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2015-12-21 14:51:26 +0100 |
commit | 7e2427148e9023483f266cd3ac4e167d50320796 (patch) | |
tree | 86496ad87a4be9f332756b8077e17a5e18b8171f /src/bridge/bridge.hpp | |
parent | 8ddbe8d3e6a5a5001537379aa4f1a418c6cb6d23 (diff) | |
download | biboumi-7e2427148e9023483f266cd3ac4e167d50320796.tar.gz biboumi-7e2427148e9023483f266cd3ac4e167d50320796.tar.bz2 biboumi-7e2427148e9023483f266cd3ac4e167d50320796.tar.xz biboumi-7e2427148e9023483f266cd3ac4e167d50320796.zip |
Use references instead of raw pointer, to store the “parent” object
In Bridge and IrcClient
Diffstat (limited to 'src/bridge/bridge.hpp')
-rw-r--r-- | src/bridge/bridge.hpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp index 7b8df8f..e73bd19 100644 --- a/src/bridge/bridge.hpp +++ b/src/bridge/bridge.hpp @@ -33,7 +33,7 @@ using irc_responder_callback_t = std::function<bool(const std::string& irc_hostn class Bridge { public: - explicit Bridge(const std::string& user_jid, BiboumiComponent* xmpp, std::shared_ptr<Poller> poller); + explicit Bridge(const std::string& user_jid, BiboumiComponent& xmpp, std::shared_ptr<Poller> poller); ~Bridge(); /** * QUIT all connected IRC servers. @@ -216,11 +216,9 @@ private: */ std::unordered_map<std::string, std::shared_ptr<IrcClient>> irc_clients; /** - * A raw pointer, because we do not own it, the XMPP component owns us, - * but we still need to communicate with it, when sending messages from - * IRC to XMPP. + * To communicate back with the XMPP component */ - BiboumiComponent* xmpp; + BiboumiComponent& xmpp; /** * Poller, to give it the IrcClients that we spawn, to make it manage * their sockets. |