MIRA
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
ProcessSpawnManager Class Reference

Implements manager that starts processes and keeps track of them in order to respawn them if required, etc. More...

#include <platform/ProcessSpawnManager.h>

Classes

struct  ProcessInfo
 

Public Types

typedef boost::shared_ptr< ProcessInfoProcessInfoPtr
 
typedef boost::function< void(const ProcessInfo &p)> RequiredProcessTerminatedFn
 

Public Member Functions

 ~ProcessSpawnManager ()
 
void startProcess (const Path &executable, const std::vector< std::string > &args, const std::string &name="", bool respawn=false, bool required=false, bool shutdownRecursively=false, boost::optional< Process::Environment > env=boost::optional< Process::Environment >(), const std::string &cleanupCmd="")
 
void startWatchdog (RequiredProcessTerminatedFn fn=RequiredProcessTerminatedFn())
 
void watchdog ()
 

Public Attributes

std::list< ProcessInfoPtrmProcesses
 
boost::thread mWatchdogThread
 
boost::mutex mMutex
 
RequiredProcessTerminatedFn mRequiredProcessTerminatedFn
 

Detailed Description

Implements manager that starts processes and keeps track of them in order to respawn them if required, etc.

Member Typedef Documentation

◆ ProcessInfoPtr

typedef boost::shared_ptr<ProcessInfo> ProcessInfoPtr

◆ RequiredProcessTerminatedFn

typedef boost::function<void(const ProcessInfo& p)> RequiredProcessTerminatedFn

Constructor & Destructor Documentation

◆ ~ProcessSpawnManager()

~ProcessSpawnManager ( )
inline

Member Function Documentation

◆ startProcess()

void startProcess ( const Path executable,
const std::vector< std::string > &  args,
const std::string &  name = "",
bool  respawn = false,
bool  required = false,
bool  shutdownRecursively = false,
boost::optional< Process::Environment env = boost::optional<Process::Environment>(),
const std::string &  cleanupCmd = "" 
)
inline

◆ startWatchdog()

void startWatchdog ( RequiredProcessTerminatedFn  fn = RequiredProcessTerminatedFn())
inline

◆ watchdog()

void watchdog ( )
inline

Member Data Documentation

◆ mProcesses

std::list<ProcessInfoPtr> mProcesses

◆ mWatchdogThread

boost::thread mWatchdogThread

◆ mMutex

boost::mutex mMutex

◆ mRequiredProcessTerminatedFn

RequiredProcessTerminatedFn mRequiredProcessTerminatedFn

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