#include <process_control.h>
Inheritance diagram for process_control:


Public Member Functions | |
| process_control () | |
| ~process_control () | |
| IMPLEMENT_CLASS_NAME ("process_control") | |
| bool | healthy () const |
| returns true if this object should be functional. | |
| process_entry | query_process (u_int to_query) |
| returns the information for just one process. | |
| bool | query_processes (process_entry_array &to_fill) |
| finds the processes that are running and drops them into "to_fill". | |
| bool | zap_process (u_int to_zap) |
| preemptively zaps the process "to_zap". | |
| void | sort_by_name (process_entry_array &to_sort) |
| void | sort_by_pid (process_entry_array &to_sort) |
Static Public Member Functions | |
| static bool | find_process_in_list (const process_entry_array &processes, const istring &app_name, int_set &pids) |
| uses a pre-existing list of "processes" to search for the "app_name". | |
This object can query the operating system for the current set of processes or zap a particular process of interest.
Definition at line 33 of file process_control.h.
| process_control::process_control | ( | ) |
Definition at line 112 of file process_control.cpp.
References portable::get_OS_version(), version::v_major(), and version::v_revision().
| process_control::~process_control | ( | ) |
| process_control::IMPLEMENT_CLASS_NAME | ( | "process_control" | ) |
| bool process_control::healthy | ( | ) | const [inline] |
returns true if this object should be functional.
if it failed to construct properly, this returns false. usually a failure indicates that a required dynamic library is missing, such as "psapi.dll" on win32.
Definition at line 41 of file process_control.h.
| process_entry process_control::query_process | ( | u_int | to_query | ) |
returns the information for just one process.
Definition at line 271 of file process_control.cpp.
References FUNCDEF, and query_processes().
| bool process_control::query_processes | ( | process_entry_array & | to_fill | ) |
finds the processes that are running and drops them into "to_fill".
Definition at line 173 of file process_control.cpp.
Referenced by shutdown_alerter::close_application(), main(), and query_process().
| bool process_control::zap_process | ( | u_int | to_zap | ) |
preemptively zaps the process "to_zap".
this does not invoke any friendly graceful shut down process, but merely terminates it if possible.
Definition at line 245 of file process_control.cpp.
References FUNCDEF, LOG, portable::system_error(), and portable::system_error_text().
Referenced by main(), process_manager::push_timed_activities(), and process_manager::zap_process().
| bool process_control::find_process_in_list | ( | const process_entry_array & | processes, | |
| const istring & | app_name, | |||
| int_set & | pids | |||
| ) | [static] |
uses a pre-existing list of "processes" to search for the "app_name".
if the process is found, true is returned and the "pids" are set to all entries matching the process name. note that this is an approximate match for some OSes that have a brain damaged process lister (such as ms-windows); they have programs listed under incomplete names in some cases.
Definition at line 296 of file process_control.cpp.
References basis::set< contents >::add(), basis::set< contents >::clear(), istring::compare(), FUNCDEF, portable::get_OS_version(), LOG, istring::lower(), version::v_major(), and version::v_minor().
Referenced by shutdown_alerter::close_application(), and process_manager::push_timed_activities().
| void process_control::sort_by_name | ( | process_entry_array & | to_sort | ) |
| void process_control::sort_by_pid | ( | process_entry_array & | to_sort | ) |
Definition at line 163 of file process_control.cpp.
1.5.1