41 const chrono::steady_clock::duration CLEAR_CHANGE_INTERVAL = chrono::milliseconds(60000);
45 m_current_status = m_status.get();
52 set_status(code, text);
53 m_last_read_error = chrono::steady_clock::now();
61 set_status(code, text);
62 m_last_write_error = chrono::steady_clock::now();
71 m_last_read_error = chrono::steady_clock::now();
80 m_last_write_error = chrono::steady_clock::now();
87 auto now = chrono::steady_clock::now();
88 lock_guard<mutex> lock(m_mutex);
89 if (now - m_last_read_error > CLEAR_CHANGE_INTERVAL &&
90 now - m_last_write_error > CLEAR_CHANGE_INTERVAL) {
97 lock_guard<mutex> lock(m_mutex);
98 m_current_status = code;
99 m_status.set(m_current_status, text);
105 strerror_r(errno, errtext, 128);
106 lock_guard<mutex> lock(m_mutex);
108 m_status.set(m_current_status, errtext);
void set_status(Status::Code code, const std::string &text)
Sets status.
StatusManager()
Constructor.
Code
Enumeration for status codes.
void set_write_status(Status::Code code, const std::string &text)
Sets write status.
void set_read_status(Status::Code code, const std::string &text)
Sets read status.
Compatibility Macros for C/C++.
void set_error(int error)
Sets status to CRITICAL with status text associated with errno.
void set_write_error(int error)
Sets status to CRITICAL with status text associated with errno.
void set_read_error(int error)
Sets status to CRITICAL with status text associated with errno.
A String class based on std::string.
void clear_status()
Clears status by setting it to OK.
File system broker framework and client library.
Declarations for StatusManager.