Safir SDK Core
Loading...
Searching...
No Matches
Safir::Utilities::ProcessInfo Class Reference

#include <Safir/Utilities/ProcessInfo.h>

Public Member Functions

 ProcessInfo (const pid_t pid)
 Create a ProcessInfo object for a specific process.
 
 ~ProcessInfo ()
 Destructor.
 
const std::string GetProcessName () const
 This method will probably return argv[0] of the process.
 

Static Public Member Functions

static pid_t GetPid ()
 Returns the pid of the current process.
 
static const std::string GetProcessDescription ()
 This method will probably return the command line used to start the current process.
 

Constructor & Destructor Documentation

◆ ProcessInfo()

Safir::Utilities::ProcessInfo::ProcessInfo ( const pid_t pid)

Create a ProcessInfo object for a specific process.

◆ ~ProcessInfo()

Safir::Utilities::ProcessInfo::~ProcessInfo ( )

Destructor.

Member Function Documentation

◆ GetPid()

static pid_t Safir::Utilities::ProcessInfo::GetPid ( )
static

Returns the pid of the current process.

◆ GetProcessDescription()

static const std::string Safir::Utilities::ProcessInfo::GetProcessDescription ( )
static

This method will probably return the command line used to start the current process.

At the very least it will return the pid as a string.

◆ GetProcessName()

const std::string Safir::Utilities::ProcessInfo::GetProcessName ( ) const

This method will probably return argv[0] of the process.

At the very least it will return the pid as a string. Be sure not to use this as a unique identifier for processes. For java processes it attempts to find the name of the running jar, and for mono processes it attempts to find the name of the running exe. No guarantees at all!