1 /* 2 * Copyright 2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef SYSTEM_INFO_H 6 #define SYSTEM_INFO_H 7 8 9 #include <OS.h> 10 11 class SystemInfoHandler; 12 13 14 class SystemInfo { 15 public: 16 SystemInfo(SystemInfoHandler* handler = NULL); 17 ~SystemInfo(); 18 19 uint64 CachedMemory() const; 20 uint64 UsedMemory() const; 21 uint64 MaxMemory() const; 22 23 uint32 UsedSemaphores() const; 24 uint32 MaxSemaphores() const; 25 26 uint32 UsedPorts() const; 27 uint32 MaxPorts() const; 28 29 uint32 UsedThreads() const; 30 uint32 MaxThreads() const; 31 32 uint32 UsedTeams() const; 33 uint32 MaxTeams() const; 34 35 bigtime_t Time() const { return fTime; } 36 uint32 CPUCount() const { return fSystemInfo.cpu_count; } 37 const system_info& Info() const { return fSystemInfo; } 38 39 uint64 NetworkReceived(); 40 uint64 NetworkSent(); 41 42 uint32 UsedRunningApps() const; 43 uint32 MaxRunningApps() const; 44 45 uint32 ClipboardSize() const; 46 uint32 ClipboardTextSize() const; 47 48 uint32 MediaNodes() const; 49 uint32 MediaConnections() const; // UNIMPLEMENTED 50 uint32 MediaBuffers() const; // UNIMPLEMENTED 51 52 private: 53 void _RetrieveNetwork(); 54 55 system_info fSystemInfo; 56 bigtime_t fTime; 57 bool fRetrievedNetwork; 58 uint64 fBytesReceived; 59 uint64 fBytesSent; 60 uint32 fRunningApps; 61 uint32 fClipboardSize; 62 uint32 fClipboardTextSize; 63 uint32 fMediaNodes; 64 uint32 fMediaConnections; 65 uint32 fMediaBuffers; 66 }; 67 68 #endif // SYSTEM_INFO_H 69