YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarp::os::SystemInfo Class Reference

A class to get the system (platform) status such as available memory, storage, CPU load and etc. More...

#include <yarp/os/SystemInfo.h>

+ Inheritance diagram for yarp::os::SystemInfo:

Public Types

typedef int capacity_t
 
typedef yarp::os::ProcessInfoData ProcessInfo
 
typedef yarp::os::MemoryInfoData MemoryInfo
 
typedef yarp::os::StorageInfoData StorageInfo
 
typedef yarp::os::ProcessorInfoData ProcessorInfo
 
typedef yarp::os::LoadInfoData LoadInfo
 
typedef yarp::os::PlatformInfoData PlatformInfo
 
typedef yarp::os::UserInfoData UserInfo
 
- Public Types inherited from yarp::os::SystemInfoData
typedef yarp::os::idl::Unwrapped< SystemInfoData > unwrapped
 

Public Member Functions

void updateSystemInfo ()
 updates the system information by calling the static methods to retrieve the latest data.
 
bool read (yarp::os::ConnectionReader &connection) override
 reads from a ConnectionReader and fill into the SystemInfo structs.
 
bool write (yarp::os::ConnectionWriter &connection) const override
 write the SystemInfo structs using a ConnectionWriter.
 
- Public Member Functions inherited from yarp::os::SystemInfoData
 SystemInfoData ()=default
 
 SystemInfoData (const MemoryInfoData &memory, const StorageInfoData &storage, const ProcessorInfoData &processor, const LoadInfoData &load, const PlatformInfoData &platform, const UserInfoData &user, const ProcessInfoData &process)
 
bool read (yarp::os::idl::WireReader &reader) override
 
bool read (yarp::os::ConnectionReader &connection) override
 Read this object from a network connection.
 
bool write (const yarp::os::idl::WireWriter &writer) const override
 
bool write (yarp::os::ConnectionWriter &connection) const override
 Write this object to a network connection.
 
std::string toString () const
 
- Public Member Functions inherited from yarp::os::idl::WirePortable
virtual bool readBare (yarp::os::ConnectionReader &reader)
 
virtual bool writeBare (yarp::os::ConnectionWriter &writer) const
 
virtual bool readBottle (yarp::os::ConnectionReader &reader)
 
virtual bool writeBottle (yarp::os::ConnectionWriter &writer) const
 
- Public Member Functions inherited from yarp::os::Portable
virtual Type getType () const
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor.
 
virtual Type getReadType () const
 
- Public Member Functions inherited from yarp::os::PortWriter
virtual ~PortWriter ()
 Destructor.
 
virtual void onCompletion () const
 This is called when the port has finished all writing operations.
 
virtual void onCommencement () const
 This is called when the port is about to begin writing operations.
 
virtual yarp::os::Type getWriteType () const
 

Static Public Member Functions

static MemoryInfo getMemoryInfo ()
 getMemoryInfo
 
static StorageInfo getStorageInfo ()
 getStorageInfo
 
static ProcessorInfo getProcessorInfo ()
 getProcessorInfo
 
static PlatformInfo getPlatformInfo ()
 getPlatformInfo
 
static LoadInfo getLoadInfo ()
 getLoadInfo
 
static UserInfo getUserInfo ()
 getUserInfo
 
static ProcessInfo getProcessInfo (int pid=0)
 gets the operating system process information given by its PID.
 
- Static Public Member Functions inherited from yarp::os::Portable
static bool copyPortable (const PortWriter &writer, PortReader &reader)
 Copy one portable to another, via writing and reading.
 

Additional Inherited Members

- Public Attributes inherited from yarp::os::SystemInfoData
MemoryInfoData memory {}
 
StorageInfoData storage {}
 
ProcessorInfoData processor {}
 
LoadInfoData load {}
 
PlatformInfoData platform {}
 
UserInfoData user {}
 
ProcessInfoData process {}
 

Detailed Description

A class to get the system (platform) status such as available memory, storage, CPU load and etc.

Definition at line 24 of file SystemInfo.h.

Member Typedef Documentation

◆ capacity_t

◆ LoadInfo

◆ MemoryInfo

◆ PlatformInfo

◆ ProcessInfo

◆ ProcessorInfo

◆ StorageInfo

◆ UserInfo

Member Function Documentation

◆ getLoadInfo()

SystemInfo::LoadInfo SystemInfo::getLoadInfo ( )
static

getLoadInfo

Returns
information about the current cpu usage (load)

Definition at line 778 of file SystemInfo.cpp.

◆ getMemoryInfo()

SystemInfo::MemoryInfo SystemInfo::getMemoryInfo ( )
static

getMemoryInfo

Returns
information about the system memory

Definition at line 255 of file SystemInfo.cpp.

◆ getPlatformInfo()

SystemInfo::PlatformInfo SystemInfo::getPlatformInfo ( )
static

getPlatformInfo

Returns
information about the operating system type

Definition at line 620 of file SystemInfo.cpp.

◆ getProcessInfo()

SystemInfo::ProcessInfo SystemInfo::getProcessInfo ( int  pid = 0)
static

gets the operating system process information given by its PID.

If the information cannot be retrieved, ProcessInfo.pid is set to -1 otherwise, it is equal to the given PID as parameter.

Parameters
pidthe process (task) PID, or 0 for current process
Returns
ProcessInfo

Definition at line 832 of file SystemInfo.cpp.

◆ getProcessorInfo()

SystemInfo::ProcessorInfo SystemInfo::getProcessorInfo ( )
static

getProcessorInfo

Returns
information about the processor type

Definition at line 448 of file SystemInfo.cpp.

◆ getStorageInfo()

SystemInfo::StorageInfo SystemInfo::getStorageInfo ( )
static

getStorageInfo

Returns
information about the system storage

Definition at line 315 of file SystemInfo.cpp.

◆ getUserInfo()

SystemInfo::UserInfo SystemInfo::getUserInfo ( )
static

getUserInfo

Returns
information about the current user

Definition at line 747 of file SystemInfo.cpp.

◆ read()

bool SystemInfo::read ( yarp::os::ConnectionReader &  connection)
overridevirtual

reads from a ConnectionReader and fill into the SystemInfo structs.

Parameters
connectiona ConnectionReader
Returns
true/false upon success or failure

Implements yarp::os::Portable.

Definition at line 609 of file SystemInfo.cpp.

◆ updateSystemInfo()

void SystemInfo::updateSystemInfo ( )

updates the system information by calling the static methods to retrieve the latest data.

Definition at line 596 of file SystemInfo.cpp.

◆ write()

bool SystemInfo::write ( yarp::os::ConnectionWriter &  connection) const
overridevirtual

write the SystemInfo structs using a ConnectionWriter.

Parameters
connectiona ConnectionWriter
Returns
true/false upon success or failure

Implements yarp::os::Portable.

Definition at line 614 of file SystemInfo.cpp.


The documentation for this class was generated from the following files: