0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
Hypertable::ServerLauncher Class Reference

Launches external commands and redirects their output to a file; kills the external process when going out of scope. More...

#include <ServerLauncher.h>

Public Member Functions

 ServerLauncher (const char *path, char *const argv[], const char *outfile=0, bool append_output=false)
 Constructor; launches the external command, optionally redirects the output. More...
 
 ~ServerLauncher ()
 Destructor; kills the external program. More...
 
int get_write_descriptor () const
 Returns stdin of the external program. More...
 
pid_t get_pid () const
 Returns the pid of the external program. More...
 

Private Attributes

const char * m_path
 The path of the external program. More...
 
pid_t m_child_pid
 The pid of the external program. More...
 
int m_write_fd
 The file descriptor writing to stdin of the external program. More...
 

Detailed Description

Launches external commands and redirects their output to a file; kills the external process when going out of scope.

This class is used for testing purposes.

Definition at line 54 of file ServerLauncher.h.

Constructor & Destructor Documentation

Hypertable::ServerLauncher::ServerLauncher ( const char *  path,
char *const  argv[],
const char *  outfile = 0,
bool  append_output = false 
)
inline

Constructor; launches the external command, optionally redirects the output.

Parameters
pathThe path of the external program
argvThe argument list of the program
outfilePath of the redirected output file (for stdout AND stderr); optional. If NULL then will use stdout/stderr of the host program
append_outputIf true, output will be appended. Otherwise output file will be overwritten

Definition at line 67 of file ServerLauncher.h.

Hypertable::ServerLauncher::~ServerLauncher ( )
inline

Destructor; kills the external program.

Definition at line 104 of file ServerLauncher.h.

Member Function Documentation

pid_t Hypertable::ServerLauncher::get_pid ( ) const
inline

Returns the pid of the external program.

Definition at line 118 of file ServerLauncher.h.

int Hypertable::ServerLauncher::get_write_descriptor ( ) const
inline

Returns stdin of the external program.

Definition at line 113 of file ServerLauncher.h.

Member Data Documentation

pid_t Hypertable::ServerLauncher::m_child_pid
private

The pid of the external program.

Definition at line 127 of file ServerLauncher.h.

const char* Hypertable::ServerLauncher::m_path
private

The path of the external program.

Definition at line 124 of file ServerLauncher.h.

int Hypertable::ServerLauncher::m_write_fd
private

The file descriptor writing to stdin of the external program.

Definition at line 130 of file ServerLauncher.h.


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