Add fatal failure checking method to Backend

The method allows the caller to check whether the backend has suffered a
fatal failure.
This commit is contained in:
Markus Mäkelä
2017-06-14 11:50:30 +03:00
parent dc8c20bf6a
commit 1fcb62895e
2 changed files with 16 additions and 0 deletions

View File

@ -182,6 +182,17 @@ public:
*/
bool is_closed() const;
/**
* @brief Check if the backend has failed fatally
*
* When a fatal failure occurs in a backend, the backend server can no longer
* be used by this session. Fatal failures can occur when the execution of
* a session command fails on the backend but the expected result is different.
*
* @return True if a fatal failure has occurred in the backend server
*/
bool has_failed() const;
private:
/**
* Internal state of the backend

View File

@ -241,3 +241,8 @@ bool Backend::is_closed() const
{
return m_state & CLOSED;
}
bool Backend::has_failed() const
{
return m_state & FATAL_FAILURE;
}