Take Backend into use in rwsplit_select_backends.cc

This is the first step to taking the Backend class into use. It is now
used in rwsplit_select_backends.cc and readwritesplit.hh. The module is
not yet functional and doesn't even compile.

Added some helper functions to the Backend class to get easier access to
the server referenced by the SERVER_REF and to check the state of the
backend.
This commit is contained in:
Markus Mäkelä
2017-06-15 13:16:52 +03:00
parent 05fef4b23e
commit 5a5effdf7a
5 changed files with 126 additions and 228 deletions

View File

@ -86,7 +86,7 @@ public:
/**
* @brief Check if backend has session commands
*
* @return True if backend has session commands
* @return Number of session commands
*/
size_t session_command_count() const;
@ -97,6 +97,20 @@ public:
*/
SERVER_REF* backend() const;
/**
* @brief Get pointer to server
*
* @return Pointer to server
*/
SERVER* server() const;
/**
* @brief Check if a connection to this backend can be made
*
* @return True if the backend has not failed and a connection can be attempted
*/
bool can_connect() const;
/**
* @brief Create a new connection
*