processes::process_control Class Reference

Provides a bridge to the operating system for information on processes. More...

#include <process_control.h>

Inheritance diagram for processes::process_control:
Inheritance graph
[legend]
Collaboration diagram for processes::process_control:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 process_control ()
virtual ~process_control ()
 DEFINE_CLASS_NAME ("process_control")
bool healthy () const
 returns true if this object should be functional.
process_entry query_process (basis::un_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 (basis::un_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 basis::astring &app_name, structures::int_set &pids)
 uses a pre-existing list of "processes" to search for the "app_name".

Detailed Description

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.


Constructor & Destructor Documentation

processes::process_control::process_control (  ) 
processes::process_control::~process_control (  )  [virtual]

Definition at line 168 of file process_control.cpp.

References basis::WHACK().


Member Function Documentation

processes::process_control::DEFINE_CLASS_NAME ( "process_control"   ) 
bool processes::process_control::find_process_in_list ( const process_entry_array processes,
const basis::astring app_name,
structures::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 323 of file process_control.cpp.

References structures::set< contents >::add(), filesystem::filename::basename(), structures::set< contents >::clear(), basis::astring::compare(), FUNCDEF, basis::array< contents >::length(), LOG, basis::astring::lower(), filesystem::filename::raw(), structures::version::v_major(), and structures::version::v_minor().

Referenced by application::hoople_service::close_application().

bool processes::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 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 298 of file process_control.cpp.

References 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 198 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 176 of file process_control.cpp.

References basis::array< contents >::length().

void processes::process_control::sort_by_pid ( process_entry_array to_sort  ) 

Definition at line 188 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 270 of file process_control.cpp.

References FUNCDEF, and LOG.

Referenced by main(), application::launch_manager::push_timed_activities(), and application::launch_manager::zap_process().


The documentation for this class was generated from the following files:
Generated on Sat Jan 28 04:25:50 2012 for hoople2 project by  doxygen 1.6.3