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#include <system_info.h>
12
13
14class SystemInfoHandler;
15
16
17class SystemInfo {
18public:
19						SystemInfo(SystemInfoHandler* handler = NULL);
20						~SystemInfo();
21
22			uint64		CachedMemory() const;
23			uint64		UsedMemory() const;
24			uint64		MaxMemory() const;
25
26			uint32		PageFaults() const;
27
28			uint64		MaxSwapSpace() const;
29			uint64		UsedSwapSpace() const;
30
31			uint32		UsedSemaphores() const;
32			uint32		MaxSemaphores() const;
33
34			uint32		UsedPorts() const;
35			uint32		MaxPorts() const;
36
37			uint32		UsedThreads() const;
38			uint32		MaxThreads() const;
39
40			uint32		UsedTeams() const;
41			uint32		MaxTeams() const;
42
43			bigtime_t	Time() const { return fTime; }
44			uint32		CPUCount() const { return fSystemInfo.cpu_count; }
45			const system_info& Info() const { return fSystemInfo; }
46
47			uint64		NetworkReceived();
48			uint64		NetworkSent();
49
50			uint32		UsedRunningApps() const;
51			uint32		MaxRunningApps() const;
52
53			uint32		ClipboardSize() const;
54			uint32		ClipboardTextSize() const;
55
56			uint32		MediaNodes() const;
57			uint32		MediaConnections() const;	// UNIMPLEMENTED
58			uint32		MediaBuffers() const;		// UNIMPLEMENTED
59
60private:
61			void		_RetrieveNetwork();
62
63	system_info			fSystemInfo;
64	system_memory_info	fMemoryInfo;
65	bigtime_t			fTime;
66	bool				fRetrievedNetwork;
67	uint64				fBytesReceived;
68	uint64				fBytesSent;
69	uint32				fRunningApps;
70	uint32				fClipboardSize;
71	uint32				fClipboardTextSize;
72	uint32				fMediaNodes;
73	uint32				fMediaConnections;
74	uint32				fMediaBuffers;
75};
76
77#endif	// SYSTEM_INFO_H
78