YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
SystemInfo.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_OS_SYSTEMINFO_H
8#define YARP_OS_SYSTEMINFO_H
9
10#include <yarp/os/Property.h>
11
12#include <string>
13
14
15namespace yarp::os {
16
25{
26public:
27 typedef int capacity_t;
28
32 typedef struct MemoryInfo
33 {
36 } MemoryInfo;
37
38
42 typedef struct StorageInfo
43 {
46 } StorageInfo;
47
51 typedef struct ProcessorInfo
52 {
53 std::string architecture;
54 std::string model;
55 std::string vendor;
56 int family;
58 int cores;
60 double frequency;
61 } ProcessorInfo;
62
63
67 typedef struct LoadInfo
68 {
69 double cpuLoad1;
70 double cpuLoad5;
71 double cpuLoad15;
73 } LoadInfo;
74
75
79 typedef struct PlatformInfo
80 {
81 std::string name;
82 std::string distribution;
83 std::string release;
84 std::string codename;
85 std::string kernel;
87 } PlatformInfo;
88
92 typedef struct UserInfo
93 {
94 std::string userName;
95 std::string realName;
96 std::string homeDir;
97 int userID;
98 } UserInfo;
99
100 /*
101 typedef struct NetworkInfo {
102 std::string mac;
103 std::string ip4;
104 std::string ip6;
105 } NetworkInfo;
106 */
107
111 typedef struct ProcessInfo
112 {
113 std::string name;
114 std::string arguments;
117 int pid;
118 } ProcessInfo;
119
120public:
125 static MemoryInfo getMemoryInfo();
126
131 static StorageInfo getStorageInfo();
132
137 static ProcessorInfo getProcessorInfo();
138
143 static PlatformInfo getPlatformInfo();
144
149 static LoadInfo getLoadInfo();
150
155 static UserInfo getUserInfo();
156
164 static ProcessInfo getProcessInfo(int pid = 0);
165
166 // static NetworkInfo getNetworkInfo();
167};
168
169
170} // namespace yarp::os
171
172#endif // YARP_OS_SYSTEMINFO_H
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
Definition Property.h:33
A class to get the system (platform) status such as available memory, storage, CPU load and etc.
Definition SystemInfo.h:25
An interface to the operating system, including Port based communication.
The LoadInfo struct holds the current cpu load information.
Definition SystemInfo.h:68
The MemoryInfo struct holds the system memory information.
Definition SystemInfo.h:33
The PlatformInfo struct holds the operating system information.
Definition SystemInfo.h:80
yarp::os::Property environmentVars
Definition SystemInfo.h:86
The ProcessInfo struct provides the operating system process information.
Definition SystemInfo.h:112
The ProcessorInfo struct holds the processor information.
Definition SystemInfo.h:52
The StorageInfo struct holds the system storage information.
Definition SystemInfo.h:43
The UserInfo struct holds the current user information.
Definition SystemInfo.h:93
#define YARP_os_API
Definition api.h:18