Safir SDK Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Safir::Utilities::ProcessInfo Class Reference

#include <Safir/Utilities/ProcessInfo.h>

Inheritance diagram for Safir::Utilities::ProcessInfo:
Collaboration diagram for Safir::Utilities::ProcessInfo:

Public Member Functions

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

Static Public Member Functions

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

Constructor & Destructor Documentation

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

Create a ProcessInfo object for a specific process.

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

Destructor.

Member Function Documentation

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

Returns the pid of the current process.

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.

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!