24#ifndef MEMORYACCESSOR_SRC_PROCESSAPI_H_
25#define MEMORYACCESSOR_SRC_PROCESSAPI_H_
32#include <unordered_set>
49 void SetBufferSize(
const size_t &buffer_size) { buffer_size_ = buffer_size; }
51 std::unordered_set<pid_t>
GetAllPids() const noexcept;
53 std::unordered_set<pid_t>
55 uint8_t
PidExists(const pid_t &pid) const noexcept;
56 uint8_t
ProcessExists(const std::
string &pname) const noexcept;
59 std::FILE *ShellCommand(const std::
string &command) const noexcept;
A class with functionality to work with system processes.
Definition processapi.h:41
uint8_t ProcessExists(const std::string &pname) const noexcept
Check if a process with the given name exists.
Definition processapi.cc:159
std::unordered_set< pid_t > FindPidsByName(const std::string &name) const noexcept
Get all PIDs by name of the process.
Definition processapi.cc:108
std::unordered_set< pid_t > GetAllPids() const noexcept
Get all PIDs existing in the system.
Definition processapi.cc:44
void SetBufferSize(const size_t &buffer_size)
Set buffer size of an instance.
Definition processapi.h:49
std::unordered_set< std::string > GetAllProcessNames() const noexcept
Get all names of processes existing in the system.
Definition processapi.cc:74
uint8_t PidExists(const pid_t &pid) const noexcept
Check if a process with the given PID exists.
Definition processapi.cc:140