geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
geopm::BatchStatusImp Class Referenceabstract

#include <BatchStatus.hpp>

Inheritance diagram for geopm::BatchStatusImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::BatchStatusImp:
Collaboration graph
[legend]

Public Member Functions

 BatchStatusImp (int read_fd, int write_fd)
 
virtual ~BatchStatusImp ()=default
 
void send_message (char msg) override
 Send an integer to the other process. More...
 
char receive_message (void) override
 Receive any integer from the other process. More...
 
void receive_message (char expect) override
 Receive specified integer from the other process. More...
 
- Public Member Functions inherited from geopm::BatchStatus
 BatchStatus ()=default
 
virtual ~BatchStatus ()=default
 

Protected Member Functions

virtual void open_fifo (void)=0
 
void check_return (int ret, const std::string &func_name)
 

Protected Attributes

int m_read_fd
 
int m_write_fd
 

Static Protected Attributes

static constexpr const char * M_DEFAULT_FIFO_PREFIX
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::BatchStatus
static std::unique_ptr< BatchStatusmake_unique_server (int client_pid, const std::string &server_key)
 
static std::unique_ptr< BatchStatusmake_unique_client (const std::string &server_key)
 
- Static Public Attributes inherited from geopm::BatchStatus
static constexpr char M_MESSAGE_READ = 'r'
 
static constexpr char M_MESSAGE_WRITE = 'w'
 
static constexpr char M_MESSAGE_CONTINUE = 'c'
 
static constexpr char M_MESSAGE_QUIT = 'q'
 
static constexpr char M_MESSAGE_TERMINATE = 't'
 

Constructor & Destructor Documentation

◆ BatchStatusImp()

geopm::BatchStatusImp::BatchStatusImp ( int  read_fd,
int  write_fd 
)

◆ ~BatchStatusImp()

virtual geopm::BatchStatusImp::~BatchStatusImp ( )
virtualdefault

Member Function Documentation

◆ check_return()

void geopm::BatchStatusImp::check_return ( int  ret,
const std::string &  func_name 
)
protected

◆ open_fifo()

virtual void geopm::BatchStatusImp::open_fifo ( void  )
protectedpure virtual

◆ receive_message() [1/2]

void geopm::BatchStatusImp::receive_message ( char  expect)
overridevirtual

Receive specified integer from the other process.

Parameters
expect[in] Value that is expected to be received from other process.
Exceptions
Exceptionif a message is received, but the message does not match the expected_message.

Implements geopm::BatchStatus.

◆ receive_message() [2/2]

char geopm::BatchStatusImp::receive_message ( void  )
overridevirtual

Receive any integer from the other process.

Returns
Message received

Implements geopm::BatchStatus.

◆ send_message()

void geopm::BatchStatusImp::send_message ( char  msg)
overridevirtual

Send an integer to the other process.

Parameters
msg[in] Message number to send.

Implements geopm::BatchStatus.

Member Data Documentation

◆ M_DEFAULT_FIFO_PREFIX

constexpr const char* geopm::BatchStatusImp::M_DEFAULT_FIFO_PREFIX
staticconstexprprotected
Initial value:
=
"/run/geopm/batch-status-"

◆ m_read_fd

int geopm::BatchStatusImp::m_read_fd
protected

◆ m_write_fd

int geopm::BatchStatusImp::m_write_fd
protected

The documentation for this class was generated from the following files: