disabled copy constructors for channel and connection objects, because the end-user is not supposed to copy them

This commit is contained in:
Emiel Bruijntjes 2014-08-29 13:17:17 +02:00
parent 8759258a3e
commit d35dba71a1
4 changed files with 24 additions and 0 deletions

View File

@ -33,6 +33,12 @@ public:
_implementation->attach(connection); _implementation->attach(connection);
} }
/**
* Copy'ing of channel objects is not supported
* @param channel
*/
Channel(const Channel &channel) = delete;
/** /**
* Destructor * Destructor
*/ */

View File

@ -133,6 +133,12 @@ protected:
ChannelImpl() {} ChannelImpl() {}
public: public:
/**
* Copy'ing of channel objects is not supported
* @param channel
*/
ChannelImpl(const ChannelImpl &channel) = delete;
/** /**
* Destructor * Destructor
*/ */

View File

@ -54,6 +54,12 @@ public:
*/ */
Connection(ConnectionHandler *handler) : _implementation(this, handler, Login(), "/") {} Connection(ConnectionHandler *handler) : _implementation(this, handler, Login(), "/") {}
/**
* No copy'ing, we do not support having two identical connection objects
* @param connection
*/
Connection(const Connection &connection) = delete;
/** /**
* Destructor * Destructor
*/ */

View File

@ -124,6 +124,12 @@ private:
ConnectionImpl(Connection *parent, ConnectionHandler *handler, const Login &login, const std::string &vhost); ConnectionImpl(Connection *parent, ConnectionHandler *handler, const Login &login, const std::string &vhost);
public: public:
/**
* Copy'ing connections is impossible
* @param connection
*/
ConnectionImpl(const ConnectionImpl &connection) = delete;
/** /**
* Destructor * Destructor
*/ */