Style fix
Move all constructors at the top of classes
This commit is contained in:
@@ -45,10 +45,6 @@ Bridge::Bridge(const std::string& user_jid, BiboumiComponent& xmpp, std::shared_
|
||||
{
|
||||
}
|
||||
|
||||
Bridge::~Bridge()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the role and affiliation, corresponding to the given irc mode */
|
||||
static std::tuple<std::string, std::string> get_role_affiliation_from_irc_mode(const char mode)
|
||||
|
||||
@@ -34,7 +34,12 @@ class Bridge
|
||||
{
|
||||
public:
|
||||
explicit Bridge(const std::string& user_jid, BiboumiComponent& xmpp, std::shared_ptr<Poller> poller);
|
||||
~Bridge();
|
||||
~Bridge() = default;
|
||||
|
||||
Bridge(const Bridge&) = delete;
|
||||
Bridge(Bridge&& other) = delete;
|
||||
Bridge& operator=(const Bridge&) = delete;
|
||||
Bridge& operator=(Bridge&&) = delete;
|
||||
/**
|
||||
* QUIT all connected IRC servers.
|
||||
*/
|
||||
@@ -239,11 +244,6 @@ private:
|
||||
* response iq.
|
||||
*/
|
||||
std::list<irc_responder_callback_t> waiting_irc;
|
||||
|
||||
Bridge(const Bridge&) = delete;
|
||||
Bridge(Bridge&& other) = delete;
|
||||
Bridge& operator=(const Bridge&) = delete;
|
||||
Bridge& operator=(Bridge&&) = delete;
|
||||
};
|
||||
|
||||
struct IRCNotConnected: public std::exception
|
||||
|
||||
@@ -16,6 +16,11 @@ public:
|
||||
Database() = default;
|
||||
~Database() = default;
|
||||
|
||||
Database(const Database&) = delete;
|
||||
Database(Database&&) = delete;
|
||||
Database& operator=(const Database&) = delete;
|
||||
Database& operator=(Database&&) = delete;
|
||||
|
||||
static void set_verbose(const bool val);
|
||||
|
||||
template<typename PersistentType>
|
||||
@@ -42,11 +47,6 @@ private:
|
||||
static std::unique_ptr<db::BibouDB> db;
|
||||
|
||||
static db::BibouDB& get_db();
|
||||
|
||||
Database(const Database&) = delete;
|
||||
Database(Database&&) = delete;
|
||||
Database& operator=(const Database&) = delete;
|
||||
Database& operator=(Database&&) = delete;
|
||||
};
|
||||
#endif /* USE_DATABASE */
|
||||
|
||||
|
||||
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -47,10 +47,6 @@ IrcMessage::IrcMessage(std::string&& command,
|
||||
{
|
||||
}
|
||||
|
||||
IrcMessage::~IrcMessage()
|
||||
{
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const IrcMessage& message)
|
||||
{
|
||||
os << "IrcMessage";
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -26,6 +26,11 @@ public:
|
||||
explicit BiboumiComponent(std::shared_ptr<Poller> poller, const std::string& hostname, const std::string& secret);
|
||||
~BiboumiComponent() = default;
|
||||
|
||||
BiboumiComponent(const BiboumiComponent&) = delete;
|
||||
BiboumiComponent(BiboumiComponent&&) = delete;
|
||||
BiboumiComponent& operator=(const BiboumiComponent&) = delete;
|
||||
BiboumiComponent& operator=(BiboumiComponent&&) = delete;
|
||||
|
||||
/**
|
||||
* Returns the bridge for the given user. If it does not exist, return
|
||||
* nullptr.
|
||||
@@ -99,11 +104,6 @@ private:
|
||||
|
||||
AdhocCommandsHandler irc_server_adhoc_commands_handler;
|
||||
AdhocCommandsHandler irc_channel_adhoc_commands_handler;
|
||||
|
||||
BiboumiComponent(const BiboumiComponent&) = delete;
|
||||
BiboumiComponent(BiboumiComponent&&) = delete;
|
||||
BiboumiComponent& operator=(const BiboumiComponent&) = delete;
|
||||
BiboumiComponent& operator=(BiboumiComponent&&) = delete;
|
||||
};
|
||||
|
||||
#endif // BIBOUMI_COMPONENT_INCLUDED
|
||||
|
||||
Reference in New Issue
Block a user