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::none, const std::string &cleanupCmd="")
 
void startWatchdog (RequiredProcessTerminatedFn fn=RequiredProcessTerminatedFn())
 

Public Attributes

std::vector< 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()

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::none,
const std::string &  cleanupCmd = "" 
)

◆ startWatchdog()

Member Data Documentation

◆ mProcesses

std::vector<ProcessInfoPtr> mProcesses

◆ mWatchdogThread

boost::thread mWatchdogThread

◆ mMutex

boost::mutex mMutex

◆ mRequiredProcessTerminatedFn

RequiredProcessTerminatedFn mRequiredProcessTerminatedFn

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