Style fix

Move all constructors at the top of classes
This commit is contained in:
louiz’
2016-05-04 14:16:40 +02:00
parent 305e01c0b5
commit af42073830
33 changed files with 157 additions and 174 deletions
-8
View File
@@ -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)
+6 -6
View File
@@ -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 {
+9 -11
View File
@@ -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
+6 -5
View File
@@ -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
-4
View File
@@ -47,10 +47,6 @@ IrcMessage::IrcMessage(std::string&& command,
{
}
IrcMessage::~IrcMessage()
{
}
std::ostream& operator<<(std::ostream& os, const IrcMessage& message)
{
os << "IrcMessage";
+5 -5
View File
@@ -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);
+8 -7
View File
@@ -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);
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;
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;
};
#endif // IRC_USER_INCLUDED