Fawkes API  Fawkes Development Version
fawkes::HostInfo Class Reference

#include <utils/system/hostinfo.h>

Public Member Functions

 HostInfo ()
 Constructor. More...
 
 ~HostInfo ()
 Destructor. More...
 
const char * name ()
 Get full hostname. More...
 
const char * short_name ()
 Get short hostname (up to first dot). More...
 
const char * domain ()
 Get domain name (after first dot or none if no dot in name). More...
 
const char * arch ()
 Get architecture (like i686 or x86_64). More...
 
const char * sys_name ()
 Get system name (like Linux). More...
 
const char * sys_release ()
 Get system release (kernel version on Linux). More...
 
const char * sys_version ()
 Get system version (build date on Linux). More...
 
void update ()
 Update information. More...
 

Detailed Description

Host information. This class provides access to basic system information like hostname, domain name, architecture and system information. It's basically a C++ wrapper to the uname system call.

Author
Tim Niemueller

Definition at line 30 of file hostinfo.h.

Constructor & Destructor Documentation

◆ HostInfo()

fawkes::HostInfo::HostInfo ( )

Constructor.

Definition at line 46 of file hostinfo.cpp.

◆ ~HostInfo()

fawkes::HostInfo::~HostInfo ( )

Destructor.

Definition at line 63 of file hostinfo.cpp.

Member Function Documentation

◆ arch()

const char * fawkes::HostInfo::arch ( )

Get architecture (like i686 or x86_64).

Returns
architecture

Definition at line 131 of file hostinfo.cpp.

◆ domain()

const char * fawkes::HostInfo::domain ( )

Get domain name (after first dot or none if no dot in name).

Returns
domain name

Definition at line 122 of file hostinfo.cpp.

◆ name()

const char * fawkes::HostInfo::name ( )

Get full hostname.

Returns
hostname

Definition at line 104 of file hostinfo.cpp.

Referenced by RobotMemory::mutex_renew_lock(), RobotMemory::mutex_try_lock(), and RobotMemory::mutex_unlock().

◆ short_name()

const char * fawkes::HostInfo::short_name ( )

Get short hostname (up to first dot).

Returns
short hostname

Definition at line 113 of file hostinfo.cpp.

Referenced by fawkes::NetworkNameResolver::hostname(), ROSNodeThread::init(), fawkes::SQLiteConfiguration::load(), and fawkes::WebPageReply::pack().

◆ sys_name()

const char * fawkes::HostInfo::sys_name ( )

Get system name (like Linux).

Returns
system name

Definition at line 140 of file hostinfo.cpp.

◆ sys_release()

const char * fawkes::HostInfo::sys_release ( )

Get system release (kernel version on Linux).

Returns
system release

Definition at line 149 of file hostinfo.cpp.

◆ sys_version()

const char * fawkes::HostInfo::sys_version ( )

Get system version (build date on Linux).

Returns
system version

Definition at line 158 of file hostinfo.cpp.

◆ update()

void fawkes::HostInfo::update ( )

Update information.

Gathers the information again.

Definition at line 74 of file hostinfo.cpp.


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