diff options
author | louiz’ <louiz@louiz.org> | 2016-05-04 14:16:40 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-05-04 14:16:40 +0200 |
commit | af42073830087d97385e507f27f601e8769541b0 (patch) | |
tree | d7187f5dcbf73cf73776c6c9dad01ad4d0a25b51 /src/irc | |
parent | 305e01c0b58ec5cfee276841488f9c24835ce923 (diff) | |
download | biboumi-af42073830087d97385e507f27f601e8769541b0.tar.gz biboumi-af42073830087d97385e507f27f601e8769541b0.tar.bz2 biboumi-af42073830087d97385e507f27f601e8769541b0.tar.xz biboumi-af42073830087d97385e507f27f601e8769541b0.zip |
Style fix
Move all constructors at the top of classes
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/iid.cpp | 8 | ||||
-rw-r--r-- | src/irc/iid.hpp | 12 | ||||
-rw-r--r-- | src/irc/irc_channel.hpp | 20 | ||||
-rw-r--r-- | src/irc/irc_client.hpp | 11 | ||||
-rw-r--r-- | src/irc/irc_message.cpp | 4 | ||||
-rw-r--r-- | src/irc/irc_message.hpp | 10 | ||||
-rw-r--r-- | src/irc/irc_user.hpp | 13 |
7 files changed, 33 insertions, 45 deletions
diff --git a/src/irc/iid.cpp b/src/irc/iid.cpp index 9d39129..212fb8f 100644 --- a/src/irc/iid.cpp +++ b/src/irc/iid.cpp @@ -51,14 +51,6 @@ void Iid::init_with_fixed_server(const std::string& iid, const std::string& host } } -Iid::Iid(const Iid& other): - is_channel(other.is_channel), - is_user(other.is_user), - local(other.local), - server(other.server) -{ -} - Iid::Iid(): is_channel(false), is_user(false) diff --git a/src/irc/iid.hpp b/src/irc/iid.hpp index 91779b2..1c026e8 100644 --- a/src/irc/iid.hpp +++ b/src/irc/iid.hpp @@ -43,8 +43,12 @@ class Iid { public: Iid(const std::string& iid); - explicit Iid(const Iid&); - explicit Iid(); + Iid(); + Iid(const Iid&) = default; + + Iid(Iid&&) = delete; + Iid& operator=(const Iid&) = delete; + Iid& operator=(Iid&&) = delete; void set_local(const std::string& loc); void set_server(const std::string& serv); @@ -63,10 +67,6 @@ private: std::string local; std::string server; - - Iid(Iid&&) = delete; - Iid& operator=(const Iid&) = delete; - Iid& operator=(Iid&&) = delete; }; namespace std { diff --git a/src/irc/irc_channel.hpp b/src/irc/irc_channel.hpp index 651b8ed..e22947b 100644 --- a/src/irc/irc_channel.hpp +++ b/src/irc/irc_channel.hpp @@ -16,6 +16,11 @@ class IrcChannel public: explicit IrcChannel(); + IrcChannel(const IrcChannel&) = delete; + IrcChannel(IrcChannel&&) = delete; + IrcChannel& operator=(const IrcChannel&) = delete; + IrcChannel& operator=(IrcChannel&&) = delete; + bool joined; std::string topic; std::string topic_author; @@ -30,12 +35,6 @@ public: protected: std::unique_ptr<IrcUser> self; std::vector<std::unique_ptr<IrcUser>> users; - -private: - IrcChannel(const IrcChannel&) = delete; - IrcChannel(IrcChannel&&) = delete; - IrcChannel& operator=(const IrcChannel&) = delete; - IrcChannel& operator=(IrcChannel&&) = delete; }; /** @@ -50,6 +49,10 @@ class DummyIrcChannel: public IrcChannel { public: explicit DummyIrcChannel(); + DummyIrcChannel(const DummyIrcChannel&) = delete; + DummyIrcChannel(DummyIrcChannel&&) = delete; + DummyIrcChannel& operator=(const DummyIrcChannel&) = delete; + DummyIrcChannel& operator=(DummyIrcChannel&&) = delete; /** * This flag is at true whenever the user wants to join this channel, but @@ -60,11 +63,6 @@ public: * the channel, we don’t use that flag, we just join it immediately. */ bool joining; -private: - DummyIrcChannel(const DummyIrcChannel&) = delete; - DummyIrcChannel(DummyIrcChannel&&) = delete; - DummyIrcChannel& operator=(const DummyIrcChannel&) = delete; - DummyIrcChannel& operator=(DummyIrcChannel&&) = delete; }; #endif // IRC_CHANNEL_INCLUDED diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp index ceaa860..7af097c 100644 --- a/src/irc/irc_client.hpp +++ b/src/irc/irc_client.hpp @@ -31,6 +31,12 @@ public: const std::string& realname, const std::string& user_hostname, Bridge& bridge); ~IrcClient(); + + IrcClient(const IrcClient&) = delete; + IrcClient(IrcClient&&) = delete; + IrcClient& operator=(const IrcClient&) = delete; + IrcClient& operator=(IrcClient&&) = delete; + /** * Connect to the IRC server */ @@ -360,11 +366,6 @@ private: * the WebIRC protocole. */ Resolver dns_resolver; - - IrcClient(const IrcClient&) = delete; - IrcClient(IrcClient&&) = delete; - IrcClient& operator=(const IrcClient&) = delete; - IrcClient& operator=(IrcClient&&) = delete; }; #endif // IRC_CLIENT_INCLUDED diff --git a/src/irc/irc_message.cpp b/src/irc/irc_message.cpp index eb3eb47..966a47c 100644 --- a/src/irc/irc_message.cpp +++ b/src/irc/irc_message.cpp @@ -47,10 +47,6 @@ IrcMessage::IrcMessage(std::string&& command, { } -IrcMessage::~IrcMessage() -{ -} - std::ostream& operator<<(std::ostream& os, const IrcMessage& message) { os << "IrcMessage"; diff --git a/src/irc/irc_message.hpp b/src/irc/irc_message.hpp index 01e78cf..29ed946 100644 --- a/src/irc/irc_message.hpp +++ b/src/irc/irc_message.hpp @@ -11,16 +11,16 @@ public: IrcMessage(std::string&& line); IrcMessage(std::string&& prefix, std::string&& command, std::vector<std::string>&& args); IrcMessage(std::string&& command, std::vector<std::string>&& args); - ~IrcMessage(); - - std::string prefix; - std::string command; - std::vector<std::string> arguments; + ~IrcMessage() = default; IrcMessage(const IrcMessage&) = delete; IrcMessage(IrcMessage&&) = delete; IrcMessage& operator=(const IrcMessage&) = delete; IrcMessage& operator=(IrcMessage&&) = delete; + + std::string prefix; + std::string command; + std::vector<std::string> arguments; }; std::ostream& operator<<(std::ostream& os, const IrcMessage& message); diff --git a/src/irc/irc_user.hpp b/src/irc/irc_user.hpp index d3397ca..4b6cd7a 100644 --- a/src/irc/irc_user.hpp +++ b/src/irc/irc_user.hpp @@ -15,18 +15,19 @@ public: explicit IrcUser(const std::string& name, const std::map<char, char>& prefix_to_mode); explicit IrcUser(const std::string& name); + + IrcUser(const IrcUser&) = delete; + IrcUser(IrcUser&&) = delete; + IrcUser& operator=(const IrcUser&) = delete; + IrcUser& operator=(IrcUser&&) = delete; + void add_mode(const char mode); void remove_mode(const char mode); char get_most_significant_mode(const std::vector<char>& sorted_user_modes) const; + std::string nick; std::string host; std::set<char> modes; - -private: - IrcUser(const IrcUser&) = delete; - IrcUser(IrcUser&&) = delete; - IrcUser& operator=(const IrcUser&) = delete; - IrcUser& operator=(IrcUser&&) = delete; }; #endif // IRC_USER_INCLUDED |