MXS-1502: Add have_session_commands helper function

The function conveys the meaning of the call better than using
session_command_count to check whether there are session commands to be
executed.
This commit is contained in:
Markus Mäkelä
2018-03-30 08:40:01 +03:00
parent 7d4f37d25b
commit 319122e621
6 changed files with 21 additions and 11 deletions

View File

@ -87,12 +87,22 @@ public:
uint64_t complete_session_command();
/**
* @brief Check if backend has session commands
* @brief Get number of session commands
*
* @return Number of session commands
*/
size_t session_command_count() const;
/**
* @brief Check if there are session commands waiting to be executed
*
* @return True if there are session commands waiting to be executed
*/
inline bool have_session_commands() const
{
return !m_session_commands.empty();
}
/**
* @brief Get the first session command
*