shared-ptr has been turned into a unique-ptr for the tcp-state
This commit is contained in:
parent
11786ff10b
commit
d2b2d5af14
|
|
@ -5,7 +5,7 @@
|
||||||
* IO between the client application and the RabbitMQ server.
|
* IO between the client application and the RabbitMQ server.
|
||||||
*
|
*
|
||||||
* @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
|
* @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
|
||||||
* @copyright 2015 - 2016 Copernica BV
|
* @copyright 2015 - 2018 Copernica BV
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -34,9 +34,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* The state of the TCP connection - this state objecs changes based on
|
* The state of the TCP connection - this state objecs changes based on
|
||||||
* the state of the connection (resolving, connected or closed)
|
* the state of the connection (resolving, connected or closed)
|
||||||
* a shared pointer is used because we use a forward declaration, which isn't
|
* @var std::unique_ptr<TcpState>
|
||||||
* allowed in a unique pointer
|
|
||||||
* @var std::shared_ptr<TcpState>
|
|
||||||
*/
|
*/
|
||||||
std::shared_ptr<TcpState> _state;
|
std::shared_ptr<TcpState> _state;
|
||||||
|
|
||||||
|
|
@ -116,7 +114,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~TcpConnection() noexcept {}
|
virtual ~TcpConnection() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filedescriptor that is used for this connection
|
* The filedescriptor that is used for this connection
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
* Implementation file for the TCP connection
|
* Implementation file for the TCP connection
|
||||||
*
|
*
|
||||||
* @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
|
* @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
|
||||||
* @copyright 2015 - 2016 Copernica BV
|
* @copyright 2015 - 2018 Copernica BV
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -27,6 +27,11 @@ TcpConnection::TcpConnection(TcpHandler *handler, const Address &address) :
|
||||||
_state(new TcpResolver(this, address.hostname(), address.port(), address.secure(), handler)),
|
_state(new TcpResolver(this, address.hostname(), address.port(), address.secure(), handler)),
|
||||||
_connection(this, address.login(), address.vhost()) {}
|
_connection(this, address.login(), address.vhost()) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destructor
|
||||||
|
*/
|
||||||
|
TcpConnection::~TcpConnection() noexcept = default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filedescriptor that is used for this connection
|
* The filedescriptor that is used for this connection
|
||||||
* @return int
|
* @return int
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue