6 #ifndef BATCHSTATUS_HPP_INCLUDE
7 #define BATCHSTATUS_HPP_INCLUDE
11 #include <unordered_map>
30 const std::string &server_key);
32 const std::string &server_key);
64 void check_return(
int ret,
const std::string &func_name);
71 "/run/geopm/batch-status-";
82 const std::string &fifo_prefix);
88 void open_fifo(
void)
override;
89 std::string m_read_fifo_path;
90 std::string m_write_fifo_path;
101 const std::string &fifo_prefix);
107 void open_fifo(
void)
override;
108 std::string m_read_fifo_path;
109 std::string m_write_fifo_path;
Definition: BatchStatus.hpp:94
BatchStatusClient & operator=(const BatchStatusClient &other)=delete
BatchStatusClient(const BatchStatusClient &other)=delete
virtual ~BatchStatusClient()
Definition: BatchStatus.cpp:174
BatchStatusClient(const std::string &server_key)
Definition: BatchStatus.cpp:160
Definition: BatchStatus.hpp:18
static constexpr char M_MESSAGE_WRITE
Definition: BatchStatus.hpp:21
virtual ~BatchStatus()=default
static constexpr char M_MESSAGE_TERMINATE
Definition: BatchStatus.hpp:24
static std::unique_ptr< BatchStatus > make_unique_client(const std::string &server_key)
Definition: BatchStatus.cpp:35
virtual void receive_message(char expect)=0
Receive specified integer from the other process.
static constexpr char M_MESSAGE_QUIT
Definition: BatchStatus.hpp:23
virtual char receive_message(void)=0
Receive any integer from the other process.
static std::unique_ptr< BatchStatus > make_unique_server(int client_pid, const std::string &server_key)
Definition: BatchStatus.cpp:27
static constexpr char M_MESSAGE_READ
Definition: BatchStatus.hpp:20
virtual void send_message(char msg)=0
Send an integer to the other process.
static constexpr char M_MESSAGE_CONTINUE
Definition: BatchStatus.hpp:22
Definition: BatchStatus.hpp:54
int m_write_fd
Definition: BatchStatus.hpp:66
char receive_message(void) override
Receive any integer from the other process.
Definition: BatchStatus.cpp:57
virtual void open_fifo(void)=0
int m_read_fd
Definition: BatchStatus.hpp:65
void send_message(char msg) override
Send an integer to the other process.
Definition: BatchStatus.cpp:51
void check_return(int ret, const std::string &func_name)
Definition: BatchStatus.cpp:79
virtual ~BatchStatusImp()=default
static constexpr const char * M_DEFAULT_FIFO_PREFIX
Definition: BatchStatus.hpp:70
BatchStatusImp(int read_fd, int write_fd)
Definition: BatchStatus.cpp:45
Definition: BatchStatus.hpp:75
virtual ~BatchStatusServer()
Definition: BatchStatus.cpp:129
BatchStatusServer(int other_pid, const std::string &server_key)
Definition: BatchStatus.cpp:93
BatchStatusServer(const BatchStatusServer &other)=delete
BatchStatusServer & operator=(const BatchStatusServer &other)=delete