geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::BatchServerImp Class Reference

#include <BatchServer.hpp>

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

Public Member Functions

 BatchServerImp (int client_pid, const std::vector< geopm_request_s > &signal_config, const std::vector< geopm_request_s > &control_config)
 
 BatchServerImp (int client_pid, const std::vector< geopm_request_s > &signal_config, const std::vector< geopm_request_s > &control_config, const std::string &signal_shmem_key, const std::string &control_shmem_key, PlatformIO &pio, std::shared_ptr< BatchStatus > batch_status, std::shared_ptr< POSIXSignal > posix_signal, std::shared_ptr< SharedMemory > signal_shmem, std::shared_ptr< SharedMemory > control_shmem, int server_pid)
 
 BatchServerImp (const BatchServerImp &other)=delete
 
BatchServerImpoperator= (const BatchServerImp &other)=delete
 
virtual ~BatchServerImp ()
 
int server_pid (void) const override
 
std::string server_key (void) const override
 
void stop_batch (void) override
 Supports the D-Bus interface for stopping a batch server. More...
 
bool is_active (void) override
 Returns true if the batch server is running. More...
 
void run_batch (void)
 
void create_shmem (void)
 
int fork_with_setup (std::function< char(void)> setup, std::function< void(void)> run)
 Fork a process that runs two functions and block until the first function completes. More...
 
void child_register_handler (void)
 
void parent_register_handler (void)
 
- Public Member Functions inherited from geopm::BatchServer
 BatchServer ()=default
 Interface called by geopmd to create the server for batch commands. More...
 
virtual ~BatchServer ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::BatchServer
static std::unique_ptr< BatchServermake_unique (int client_pid, const std::vector< geopm_request_s > &signal_config, const std::vector< geopm_request_s > &control_config)
 Supports the D-Bus interface for starting a batch server. More...
 
static std::string get_signal_shmem_key (const std::string &server_key)
 
static std::string get_control_shmem_key (const std::string &server_key)
 
- Static Protected Attributes inherited from geopm::BatchServer
static constexpr const char * M_SHMEM_PREFIX
 

Constructor & Destructor Documentation

◆ BatchServerImp() [1/3]

geopm::BatchServerImp::BatchServerImp ( int  client_pid,
const std::vector< geopm_request_s > &  signal_config,
const std::vector< geopm_request_s > &  control_config 
)

◆ BatchServerImp() [2/3]

geopm::BatchServerImp::BatchServerImp ( int  client_pid,
const std::vector< geopm_request_s > &  signal_config,
const std::vector< geopm_request_s > &  control_config,
const std::string &  signal_shmem_key,
const std::string &  control_shmem_key,
PlatformIO pio,
std::shared_ptr< BatchStatus batch_status,
std::shared_ptr< POSIXSignal posix_signal,
std::shared_ptr< SharedMemory signal_shmem,
std::shared_ptr< SharedMemory control_shmem,
int  server_pid 
)

◆ BatchServerImp() [3/3]

geopm::BatchServerImp::BatchServerImp ( const BatchServerImp other)
delete

◆ ~BatchServerImp()

geopm::BatchServerImp::~BatchServerImp ( )
virtual

Member Function Documentation

◆ child_register_handler()

void geopm::BatchServerImp::child_register_handler ( void  )

◆ create_shmem()

void geopm::BatchServerImp::create_shmem ( void  )

◆ fork_with_setup()

int geopm::BatchServerImp::fork_with_setup ( std::function< char(void)>  setup,
std::function< void(void)>  run 
)

Fork a process that runs two functions and block until the first function completes.

◆ is_active()

bool geopm::BatchServerImp::is_active ( void  )
overridevirtual

Returns true if the batch server is running.

Implements geopm::BatchServer.

◆ operator=()

BatchServerImp& geopm::BatchServerImp::operator= ( const BatchServerImp other)
delete

◆ parent_register_handler()

void geopm::BatchServerImp::parent_register_handler ( void  )

◆ run_batch()

void geopm::BatchServerImp::run_batch ( void  )

◆ server_key()

std::string geopm::BatchServerImp::server_key ( void  ) const
overridevirtual
Returns
The key used to identify the server connection: a substring in interprocess shared memory keys used for communication.

Implements geopm::BatchServer.

◆ server_pid()

int geopm::BatchServerImp::server_pid ( void  ) const
overridevirtual
Returns
The Unix process ID of the server process created.

Implements geopm::BatchServer.

◆ stop_batch()

void geopm::BatchServerImp::stop_batch ( void  )
overridevirtual

Supports the D-Bus interface for stopping a batch server.

This function is called directly by geopmd in order to end a batch session and kill the batch server process created by start_batch_server().

Implements geopm::BatchServer.


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