repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / activitymonitor / SystemInfo.h
blob065eb234bd6b905cda05fef58e4874b083f682a9
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
9 #include <OS.h>
11 #include <system_info.h>
14 class SystemInfoHandler;
17 class SystemInfo {
18 public:
19 SystemInfo(SystemInfoHandler* handler = NULL);
20 ~SystemInfo();
22 uint64 CachedMemory() const;
23 uint64 BlockCacheMemory() const;
24 uint64 UsedMemory() const;
25 uint64 MaxMemory() const;
27 uint32 PageFaults() const;
29 uint64 MaxSwapSpace() const;
30 uint64 UsedSwapSpace() const;
32 uint32 UsedSemaphores() const;
33 uint32 MaxSemaphores() const;
35 uint32 UsedPorts() const;
36 uint32 MaxPorts() const;
38 uint32 UsedThreads() const;
39 uint32 MaxThreads() const;
41 uint32 UsedTeams() const;
42 uint32 MaxTeams() const;
44 bigtime_t Time() const { return fTime; }
45 uint32 CPUCount() const { return fSystemInfo.cpu_count; }
46 bigtime_t CPUActiveTime(uint32 cpu) const
47 { return fCPUInfos[cpu].active_time; }
48 const system_info& Info() const { return fSystemInfo; }
50 uint64 NetworkReceived();
51 uint64 NetworkSent();
53 uint32 UsedRunningApps() const;
54 uint32 MaxRunningApps() const;
56 uint32 ClipboardSize() const;
57 uint32 ClipboardTextSize() const;
59 uint32 MediaNodes() const;
60 uint32 MediaConnections() const; // UNIMPLEMENTED
61 uint32 MediaBuffers() const; // UNIMPLEMENTED
63 private:
64 void _RetrieveNetwork();
66 system_info fSystemInfo;
67 cpu_info* fCPUInfos;
68 bigtime_t fTime;
69 bool fRetrievedNetwork;
70 uint64 fBytesReceived;
71 uint64 fBytesSent;
72 uint32 fRunningApps;
73 uint32 fClipboardSize;
74 uint32 fClipboardTextSize;
75 uint32 fMediaNodes;
76 uint32 fMediaConnections;
77 uint32 fMediaBuffers;
80 #endif // SYSTEM_INFO_H