login and vhost can now be fetched from the connection class

This commit is contained in:
Michael van der Werve 2014-08-19 14:54:30 +02:00
parent 328820f898
commit acda90655d
2 changed files with 21 additions and 3 deletions

View File

@ -58,6 +58,24 @@ public:
* Destructor * Destructor
*/ */
virtual ~Connection() {} virtual ~Connection() {}
/**
* Retrieve the login data
* @return Login
*/
const Login &login() const
{
return _implementation.login();
}
/**
* Retrieve the vhost
* @return string
*/
const std::string &vhost() const
{
return _implemention.vhost();
}
/** /**
* Parse data that was recevied from RabbitMQ * Parse data that was recevied from RabbitMQ

View File

@ -145,7 +145,7 @@ public:
* Are we fully connected? * Are we fully connected?
* @return bool * @return bool
*/ */
bool connected() bool connected() const
{ {
// state must be connected // state must be connected
return _state == state_connected; return _state == state_connected;
@ -160,7 +160,7 @@ public:
* Retrieve the login data * Retrieve the login data
* @return Login * @return Login
*/ */
Login &login() const Login &login() const
{ {
return _login; return _login;
} }
@ -169,7 +169,7 @@ public:
* Retrieve the vhost * Retrieve the vhost
* @return string * @return string
*/ */
std::string &vhost() const std::string &vhost() const
{ {
return _vhost; return _vhost;
} }