| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- File List
- File Members

# ProcessDescriptor.h

Go to the documentation of this file.

    00001 // $Id: ProcessDescriptor.h,v 1.3 2006/12/10 20:29:18 leggett Exp $
    00002 #ifndef GAUDIKERNEL_PROCESS_H
    00003 #define GAUDIKERNEL_PROCESS_H
    00004
    00005 // Framework include files
    00006 #include "GaudiKernel/Kernel.h"
    00007 #include "GaudiKernel/SystemBase.h"
    00008
    00009 namespace System    {
    00010   // Forward declarations
    00011   class ProcessDescriptor;
    00013   ProcessDescriptor* getProcess();
    00014
    00018   typedef struct _PEB *PPEB;
    00019   struct PROCESS_BASIC_INFORMATION {
    00020       long  ExitStatus;
    00021       PPEB  PebBaseAddress;
    00022       unsigned long  AffinityMask;
    00023       long           BasePriority;
    00024       unsigned long  UniqueProcessId;
    00025       unsigned long  InheritedFromUniqueProcessId;
    00026   };
    00027
    00033   struct QUOTA_LIMITS {
    00034       unsigned long PagedPoolLimit;
    00035       unsigned long NonPagedPoolLimit;
    00036       unsigned long MinimumWorkingSetSize;
    00037       unsigned long MaximumWorkingSetSize;
    00038       unsigned long PagefileLimit;
    00039       longlong      TimeLimit;
    00040   };
    00041
    00045   struct IO_COUNTERS {
    00046       unsigned long ReadOperationCount;
    00047       unsigned long WriteOperationCount;
    00048       unsigned long OtherOperationCount;
    00049     //      longlong ReadOperationCount;
    00050     //      longlong WriteOperationCount;
    00051     //      longlong OtherOperationCount;
    00052       longlong ReadTransferCount;
    00053       longlong WriteTransferCount;
    00054       longlong OtherTransferCount;
    00055   };
    00056
    00060   struct VM_COUNTERS {
    00061       unsigned long PeakVirtualSize;
    00062       unsigned long VirtualSize;
    00063       unsigned long PageFaultCount;
    00064       unsigned long PeakWorkingSetSize;
    00065       unsigned long WorkingSetSize;
    00066       unsigned long QuotaPeakPagedPoolUsage;
    00067       unsigned long QuotaPagedPoolUsage;
    00068       unsigned long QuotaPeakNonPagedPoolUsage;
    00069       unsigned long QuotaNonPagedPoolUsage;
    00070       unsigned long PagefileUsage;
    00071       unsigned long PeakPagefileUsage;
    00072   };
    00073
    00074
    00078   struct POOLED_USAGE_AND_LIMITS {
    00079       unsigned long PeakPagedPoolUsage;
    00080       unsigned long PagedPoolUsage;
    00081       unsigned long PagedPoolLimit;
    00082       unsigned long PeakNonPagedPoolUsage;
    00083       unsigned long NonPagedPoolUsage;
    00084       unsigned long NonPagedPoolLimit;
    00085       unsigned long PeakPagefileUsage;
    00086       unsigned long PagefileUsage;
    00087       unsigned long PagefileLimit;
    00088   };
    00089
    00094   struct KERNEL_USER_TIMES {
    00095       longlong CreateTime;
    00096       longlong ExitTime;
    00097       longlong KernelTime;
    00098       longlong UserTime;
    00099       //longlong EllapsedTime; // Added by M.Frank
    00100   };
    00101
    00110   class ProcessDescriptor  {
    00111     class ProcessHandle  {
    00112       void* m_handle;
    00113       bool  m_needRelease;
    00114     public:
    00115       ProcessHandle(long pid);
    00116       virtual ~ProcessHandle();
    00117       long item()  {
    00118         return m_needRelease ? 1 : 0;
    00119       }
    00120       void* handle()    {
    00121         return m_handle;
    00122       }
    00123     };
    00124     long                      m_PRIORITYBOOST[2];
    00125     IO_COUNTERS               m_IO_COUNTERS[2];
    00126     VM_COUNTERS               m_VM_COUNTERS[2];
    00127     KERNEL_USER_TIMES         m_KERNEL_USER_TIMES[2];
    00128     POOLED_USAGE_AND_LIMITS   m_POOLED_USAGE_AND_LIMITS[2];
    00129     QUOTA_LIMITS              m_QUOTA_LIMITS[2];
    00130     PROCESS_BASIC_INFORMATION m_PROCESS_BASIC_INFORMATION[2];
    00131   public:
    00132     ProcessDescriptor();
    00133     virtual ~ProcessDescriptor();
    00134     long query(long pid, InfoType info, PROCESS_BASIC_INFORMATION* buffer);
    00135     long query(long pid, InfoType info, POOLED_USAGE_AND_LIMITS* buffer);
    00136     long query(long pid, InfoType info, KERNEL_USER_TIMES* buffer);
    00137     long query(long pid, InfoType info, QUOTA_LIMITS* buffer);
    00138     long query(long pid, InfoType info, VM_COUNTERS* buffer);
    00139     long query(long pid, InfoType info, IO_COUNTERS* buffer);
    00140     long query(long pid, InfoType info, long* buffer);
    00141   };
    00142 }
    00143 #endif //GAUDIKERNEL_PROCESS_H