winss
|
Serializes the state file but can also read it as a human-readable message. More...
#include <state_file.hpp>
Public Member Functions | |
SuperviseStateFile (fs::path service_dir) | |
Supervise state file constructor. More... | |
SuperviseStateFile (const SuperviseStateFile &)=delete | |
No copy. More... | |
SuperviseStateFile (SuperviseStateFile &&)=delete | |
No move. More... | |
virtual const fs::path & | GetPath () const |
Gets the path of the state file. More... | |
virtual bool | Notify (winss::SuperviseNotification notification, const winss::SuperviseState &state) |
Supervisor listener handler. More... | |
virtual bool | Read (winss::SuperviseState *state) const |
Read the state of the supervisor from the file. More... | |
virtual std::string | Format (const winss::SuperviseState &state, bool is_up) const |
Format the state as a human-readable string. More... | |
SuperviseStateFile & | operator= (const SuperviseStateFile &)=delete |
No copy. More... | |
SuperviseStateFile & | operator= (SuperviseStateFile &&)=delete |
No move. More... | |
![]() | |
virtual | ~SuperviseListener () |
Default virtual destructor. More... | |
Static Public Attributes | |
static const char | kStateFile [] = "state" |
The state file name. More... | |
Serializes the state file but can also read it as a human-readable message.
|
explicit |
Supervise state file constructor.
service_dir | The service directory. |
|
delete |
No copy.
|
delete |
No move.
|
virtual |
Format the state as a human-readable string.
[in] | state | The state of the supervisor. |
[in] | is_up | Hints if the supervisor is currently up. |
References winss::SuperviseState::exit_code, winss::SuperviseState::initially_up, winss::SuperviseState::is_run_process, winss::SuperviseState::is_up, winss::SuperviseState::last, winss::SuperviseState::pid, winss::SuperviseState::remaining_count, and winss::SuperviseState::up_count.
|
virtual |
Gets the path of the state file.
|
virtual |
Supervisor listener handler.
[in] | notification | The event which occurred. |
[in] | state | The current state of the supervisor. |
Implements winss::SuperviseListener.
References winss::Utils::ConvertToISOString(), winss::SuperviseState::exit_code, FILESYSTEM, winss::SuperviseState::initially_up, winss::SuperviseState::is_run_process, winss::SuperviseState::is_up, winss::SuperviseTmpl< TMutex, TProcess >::kFinishFile, winss::SuperviseTmpl< TMutex, TProcess >::kRunFile, winss::SuperviseState::last, winss::SuperviseState::pid, winss::SuperviseState::remaining_count, winss::SuperviseState::time, and winss::SuperviseState::up_count.
|
delete |
No copy.
|
delete |
No move.
|
virtual |
Read the state of the supervisor from the file.
[out] | state | The state of the supervisor. |
References winss::Utils::ConvertFromISOString(), winss::SuperviseState::exit_code, FILESYSTEM, winss::SuperviseState::initially_up, winss::SuperviseState::is_run_process, winss::SuperviseState::is_up, winss::SuperviseState::last, winss::SuperviseState::pid, winss::SuperviseState::remaining_count, winss::SuperviseState::time, and winss::SuperviseState::up_count.
Referenced by winss::SuperviseStateListener::HandleConnected().
|
static |
The state file name.