process-cpp: core::posix::linux::proc::process Namespace Reference

process-cpp 3.0.0 A simple convenience library for handling processes in C++11.

Classes | Enumerations | Functions
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 | State { State::undefined = -1, State::running = 'R', State::sleeping = 'S', State::disk_sleep = 'D', State::zombie = 'Z', State::traced_or_stopped = 'T', State::paging = 'W' }

## Functions
CORE_POSIX_DLL_PUBLIC const posix::Process & | operator>> (const posix::Process &process, OomAdj &adj)
| Read the OomAdj value for a process instance. More...
CORE_POSIX_DLL_PUBLIC const posix::Process & | operator<< (const posix::Process &process, const OomAdj &adj)
| Write the OomAdj value for a process instance. More...
CORE_POSIX_DLL_PUBLIC const posix::Process & | operator>> (const posix::Process &process, OomScore &score)
| Read the OomScore for a process instance. More...
CORE_POSIX_DLL_PUBLIC const posix::Process & | operator>> (const posix::Process &process, OomScoreAdj &score_adj)
| Read the OomScoreAdj value for a process instance. More...
CORE_POSIX_DLL_PUBLIC const posix::Process & | operator<< (const posix::Process &process, const OomScoreAdj &score_adj)
| Write the OomScoreAdj value for a process instance. More...
CORE_POSIX_DLL_PUBLIC const posix::Process & | operator>> (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

enum core::posix::linux::proc::process::State
| strong

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_error | in case of errors and std::logic_error if score_adj.is_valid() returns false.

Parameters

  [in] | process | The process to write the score for.
  [in] | adj | The new value to store.

Definition at line 65 of file oom_adj.cpp.

References core::posix::linux::proc::process::OomAdj::is_valid(), core::posix::Process::pid(), and core::posix::linux::proc::process::OomAdj::value.

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_error | in case of errors and std::logic_error if score_adj.is_valid() returns false.

Parameters

  [in] | process | The process to write the score for.
  [in] | score_adj | The new value to store.

Definition at line 60 of file oom_score_adj.cpp.

References core::posix::linux::proc::process::OomScoreAdj::is_valid(), core::posix::Process::pid(), and core::posix::linux::proc::process::OomScoreAdj::value.

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_error | in case of errors.

Parameters

  [in] | process | The process to read the score for.
  [out] | adj | The destination to store the value in.

Definition at line 55 of file oom_adj.cpp.

References core::posix::Process::pid(), and core::posix::linux::proc::process::OomAdj::value.

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_error | in case of errors.

Parameters

  [in] | process | The process to read the score for.
  [out] | score | The destination to store the value in.

Definition at line 36 of file oom_score.cpp.

References core::posix::Process::pid(), and core::posix::linux::proc::process::OomScore::value.

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_error | in case of errors.

Parameters

  [in] | process | The process to read the score for.
  [out] | score_adj | The destination to store the value in.

Definition at line 50 of file oom_score_adj.cpp.

References core::posix::Process::pid(), and core::posix::linux::proc::process::OomScoreAdj::value.

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::linux::proc::process::Stat::addresses, core::posix::linux::proc::process::Stat::aggregated_block_io_delays, core::posix::linux::proc::process::Stat::blocked, core::posix::linux::proc::process::Stat::caught, core::posix::linux::proc::process::Stat::channel, core::posix::linux::proc::process::Stat::controlling_process_group, core::posix::linux::proc::process::Stat::cpu_count, core::posix::linux::proc::process::Stat::end_code, core::posix::linux::proc::process::Stat::executable, core::posix::linux::proc::process::Stat::exit_signal, core::posix::linux::proc::process::Stat::guest_time, core::posix::linux::proc::process::Stat::guest_time_children, core::posix::linux::proc::process::Stat::ignored, core::posix::linux::proc::process::Stat::instruction_pointer, core::posix::linux::proc::process::Stat::kernel_flags, core::posix::linux::proc::process::Stat::major_faults_count, core::posix::linux::proc::process::Stat::major_faults_count_by_children, core::posix::linux::proc::process::Stat::minor_faults_count, core::posix::linux::proc::process::Stat::minor_faults_count_by_children, core::posix::linux::proc::process::Stat::nice, core::posix::linux::proc::process::Stat::parent, core::posix::linux::proc::process::Stat::pending, core::posix::linux::proc::process::Stat::pid, core::posix::linux::proc::process::Stat::priority, core::posix::linux::proc::process::Stat::process_group, core::posix::linux::proc::process::Stat::realtime_priority, core::posix::linux::proc::process::Stat::resident_set, core::posix::linux::proc::process::Stat::resident_set_limit, core::posix::linux::proc::process::Stat::scheduling_policy, core::posix::linux::proc::process::Stat::session_id, core::posix::linux::proc::process::Stat::signals, core::posix::linux::proc::process::Stat::size, core::posix::linux::proc::process::Stat::stack_pointer, core::posix::linux::proc::process::Stat::start_code, core::posix::linux::proc::process::Stat::start_stack, core::posix::linux::proc::process::Stat::start_time, core::posix::linux::proc::process::Stat::state, core::posix::linux::proc::process::Stat::swap_count, core::posix::linux::proc::process::Stat::swap_count_children, core::posix::linux::proc::process::Stat::system, core::posix::linux::proc::process::Stat::system_for_children, core::posix::linux::proc::process::Stat::thread_count, core::posix::linux::proc::process::Stat::time, core::posix::linux::proc::process::Stat::time_before_next_sig_alarm, core::posix::linux::proc::process::Stat::tty_nr, core::posix::linux::proc::process::Stat::user, core::posix::linux::proc::process::Stat::user_for_children, and core::posix::linux::proc::process::Stat::virt.

## ◆ operator>>() [6/6]

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

Definition at line 37 of file stat.cpp.