feisty meow concerns codebase
2.140
|
Provides a bridge to the operating system for information on processes. More...
#include <process_control.h>
Public Member Functions | |
process_control () | |
virtual | ~process_control () |
DEFINE_CLASS_NAME ("process_control") | |
bool | healthy () const |
returns true if this object should be functional. More... | |
process_entry | query_process (basis::un_int to_query) |
returns the information for just one process. More... | |
bool | query_processes (process_entry_array &to_fill) |
finds the processes that are running and drops them into "to_fill". More... | |
bool | zap_process (basis::un_int to_zap) |
preemptively zaps the process "to_zap". More... | |
void | sort_by_name (process_entry_array &to_sort) |
void | sort_by_pid (process_entry_array &to_sort) |
Public Member Functions inherited from basis::nameable | |
virtual const char * | class_name () const =0 |
Returns the bare name of this class as a constant character pointer. More... | |
Static Public Member Functions | |
static bool | find_process_in_list (const process_entry_array &processes, const basis::astring &app_name, structures::int_set &pids) |
uses a pre-existing list of "processes" to search for the "app_name". More... | |
Provides a bridge to the operating system for information on processes.
This object can query the operating system for the current set of processes or zap a particular process of interest.
Definition at line 36 of file process_control.h.
processes::process_control::process_control | ( | ) |
Definition at line 136 of file process_control.cpp.
References structures::version::v_major(), and structures::version::v_revision().
|
virtual |
Definition at line 165 of file process_control.cpp.
References basis::WHACK().
processes::process_control::DEFINE_CLASS_NAME | ( | "process_control" | ) |
|
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 317 of file process_control.cpp.
References structures::set< contents >::add(), structures::set< contents >::clear(), basis::astring::compare(), FUNCDEF, LOG, basis::astring::lower(), eml_to_txt::path, structures::version::v_major(), and structures::version::v_minor().
Referenced by application::hoople_service::close_application().
|
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 44 of file process_control.h.
process_entry processes::process_control::query_process | ( | basis::un_int | to_query | ) |
returns the information for just one process.
Definition at line 293 of file process_control.cpp.
References FUNCDEF, basis::array< contents >::length(), and query_processes().
bool processes::process_control::query_processes | ( | process_entry_array & | to_fill | ) |
finds the processes that are running and drops them into "to_fill".
Definition at line 195 of file process_control.cpp.
Referenced by application::hoople_service::close_application(), main(), and query_process().
void processes::process_control::sort_by_name | ( | process_entry_array & | to_sort | ) |
Definition at line 173 of file process_control.cpp.
References filesystem::filename::basename(), basis::array< contents >::length(), eml_to_txt::path, and filesystem::filename::raw().
void processes::process_control::sort_by_pid | ( | process_entry_array & | to_sort | ) |
Definition at line 185 of file process_control.cpp.
References basis::array< contents >::length().
bool processes::process_control::zap_process | ( | basis::un_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 266 of file process_control.cpp.
Referenced by main(), application::launch_manager::push_timed_activities(), and application::launch_manager::zap_process().