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

#include <Safir/Utilities/ProcessMonitor.h>

Public Types

typedef boost::function< void(const
pid_t pid)> 
OnTerminateCb
 

Public Member Functions

 ProcessMonitor ()
 
 ~ProcessMonitor ()
 
void Init (const OnTerminateCb &callback)
 Init the ProcessMonitor. More...
 
void StartMonitorPid (const pid_t pid)
 Start monitor the given PID. More...
 
void StopMonitorPid (const pid_t pid)
 Stop monitor the given PID. More...
 

Member Typedef Documentation

typedef boost::function<void(const pid_t pid)> Safir::Utilities::ProcessMonitor::OnTerminateCb

Constructor & Destructor Documentation

Safir::Utilities::ProcessMonitor::ProcessMonitor ( )
Safir::Utilities::ProcessMonitor::~ProcessMonitor ( )

Member Function Documentation

void Safir::Utilities::ProcessMonitor::Init ( const OnTerminateCb callback)

Init the ProcessMonitor.

This method must be called first thing and before any call to StartMonitorPid or StopMonitorPid.

Parameters
[in]callbackThe function to be called when a monitored process exists. Note that this function is executed in ProcessMonitor's own thread.
void Safir::Utilities::ProcessMonitor::StartMonitorPid ( const pid_t  pid)

Start monitor the given PID.

Parameters
[in]pidThe PID which we want to monitor.
void Safir::Utilities::ProcessMonitor::StopMonitorPid ( const pid_t  pid)

Stop monitor the given PID.

Parameters
[in]pidThe PID which we want to stop monitor.