process-cpp 3.0.0
A simple convenience library for handling processes in C++11.
core::posix::linux::proc::process Namespace Reference

Classes

struct  OomAdj
 
struct  OomScore
 
struct  OomScoreAdj
 
struct  Stat
 The Stat struct encapsulates status information about a process. More...
 

Enumerations

enum class  State {
  undefined = -1 ,
  running = 'R' ,
  sleeping = 'S' ,
  disk_sleep = 'D' ,
  zombie = 'Z' ,
  traced_or_stopped = 'T' ,
  paging = 'W'
}
 

Functions

CORE_POSIX_DLL_PUBLIC const posix::Processoperator>> (const posix::Process &process, OomAdj &adj)
 Read the OomAdj value for a process instance.
 
CORE_POSIX_DLL_PUBLIC const posix::Processoperator<< (const posix::Process &process, const OomAdj &adj)
 Write the OomAdj value for a process instance.
 
CORE_POSIX_DLL_PUBLIC const posix::Processoperator>> (const posix::Process &process, OomScore &score)
 Read the OomScore for a process instance.
 
CORE_POSIX_DLL_PUBLIC const posix::Processoperator>> (const posix::Process &process, OomScoreAdj &score_adj)
 Read the OomScoreAdj value for a process instance.
 
CORE_POSIX_DLL_PUBLIC const posix::Processoperator<< (const posix::Process &process, const OomScoreAdj &score_adj)
 Write the OomScoreAdj value for a process instance.
 
CORE_POSIX_DLL_PUBLIC const posix::Processoperator>> (const posix::Process &process, Stat &stat)
 
std::istream & operator>> (std::istream &in, State &state)
 
std::istream & operator>> (std::istream &in, Stat &stat)
 

Enumeration Type Documentation

◆ State

Enumerator
undefined 
running 
sleeping 
disk_sleep 
zombie 
traced_or_stopped 
paging 

Definition at line 35 of file state.h.

Function Documentation

◆ operator<<() [1/2]

const posix::Process & core::posix::linux::proc::process::operator<< ( const posix::Process & process,
const OomAdj & adj )

Write the OomAdj value for a process instance.

Exceptions
std::runtime_errorin case of errors and std::logic_error if score_adj.is_valid() returns false.
Parameters
[in]processThe process to write the score for.
[in]adjThe new value to store.

Definition at line 65 of file oom_adj.cpp.

References core::posix::Process::pid().

+ Here is the call graph for this function:

◆ operator<<() [2/2]

const posix::Process & core::posix::linux::proc::process::operator<< ( const posix::Process & process,
const OomScoreAdj & score_adj )

Write the OomScoreAdj value for a process instance.

Exceptions
std::runtime_errorin case of errors and std::logic_error if score_adj.is_valid() returns false.
Parameters
[in]processThe process to write the score for.
[in]score_adjThe new value to store.

Definition at line 60 of file oom_score_adj.cpp.

References core::posix::Process::pid().

+ Here is the call graph for this function:

◆ operator>>() [1/6]

const posix::Process & core::posix::linux::proc::process::operator>> ( const posix::Process & process,
OomAdj & adj )

Read the OomAdj value for a process instance.

Exceptions
std::runtime_errorin case of errors.
Parameters
[in]processThe process to read the score for.
[out]adjThe destination to store the value in.

Definition at line 55 of file oom_adj.cpp.

References core::posix::Process::pid().

+ Here is the call graph for this function:

◆ operator>>() [2/6]

const posix::Process & core::posix::linux::proc::process::operator>> ( const posix::Process & process,
OomScore & score )

Read the OomScore for a process instance.

Exceptions
std::runtime_errorin case of errors.
Parameters
[in]processThe process to read the score for.
[out]scoreThe destination to store the value in.

Definition at line 36 of file oom_score.cpp.

References core::posix::Process::pid().

+ Here is the call graph for this function:

◆ operator>>() [3/6]

const posix::Process & core::posix::linux::proc::process::operator>> ( const posix::Process & process,
OomScoreAdj & score_adj )

Read the OomScoreAdj value for a process instance.

Exceptions
std::runtime_errorin case of errors.
Parameters
[in]processThe process to read the score for.
[out]score_adjThe destination to store the value in.

Definition at line 50 of file oom_score_adj.cpp.

References core::posix::Process::pid().

+ Here is the call graph for this function:

◆ operator>>() [4/6]

const posix::Process & core::posix::linux::proc::process::operator>> ( const posix::Process & process,
Stat & stat )

Definition at line 93 of file stat.cpp.

References core::posix::Process::pid().

+ Here is the call graph for this function:

◆ operator>>() [5/6]

std::istream & core::posix::linux::proc::process::operator>> ( std::istream & in,
Stat & stat )

Definition at line 43 of file stat.cpp.

References core::posix::Process::pid().

+ Here is the call graph for this function:

◆ operator>>() [6/6]

std::istream & core::posix::linux::proc::process::operator>> ( std::istream & in,
State & state )

Definition at line 37 of file stat.cpp.