home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / sysba021.zip / SRC.ZIP / sysbar2 / Piper / cpuload / pscoll.h < prev    next >
C/C++ Source or Header  |  1998-07-22  |  1KB  |  52 lines

  1. /*
  2. ** Module   :PSCOLL.H
  3. ** Abstract :Process collection
  4. **
  5. ** Copyright (C) Sergey I. Yevtushenko
  6. ** Log: Fri  05/09/97   Last cleanup before sending it.
  7. */
  8.  
  9. #ifndef  __COLLECT_H
  10. #include "collect.h"
  11. #endif
  12.  
  13. #ifndef  __PSCOLL_H
  14. #define  __PSCOLL_H
  15.  
  16.  
  17. struct ProcInfo
  18. {
  19.     int iPid;
  20.     int iSid;
  21.     int iType;
  22.     int iTouched;
  23.     int lOldUser;
  24.     int lDeltaUser;
  25.     int lOldSystem;
  26.     int lDeltaSystem;
  27.  
  28.     char cProxName[1025];
  29. };
  30.  
  31. typedef ProcInfo* PInfo;
  32.  
  33. class ProcessCollection:public SortedCollection
  34. {
  35.         ProcInfo * CheckAndInsert(ProcInfo *, int&);
  36.         ProcInfo * ProcessCollection::LocatePID(int pid);
  37.         unsigned long ulTotalUsr;
  38.         unsigned long ulTotalSys;
  39.  
  40.     public:
  41.         ProcessCollection() {}
  42.         ~ProcessCollection(){}
  43.  
  44. //        void Print( char *pszBuf );
  45.         int GetCPULoad( void );
  46.         void CollectData();
  47.         virtual int Compare(Ptr p1,Ptr p2) {return PInfo(p1)->iPid - PInfo(p2)->iPid;}
  48. };
  49.  
  50. #endif //__PSCOLL_H
  51.  
  52.