hamigaki.png

前のページ 上に戻る ホーム 次のページ

Class child

hamigaki::process::child —

子プロセスを生成し、通信するためのクラス。

Synopsis

class child {
public:
  // construct/copy/destruct
  child(const std::string&, const std::vector<std::string>&, 
        const environment&, const context& = context());
  child(const std::string&, const std::vector<std::string>&, 
        const context& = context());
  child(const std::string&, const environment&, const context& = context());
  child(const std::string&, const context& = context());

  // modifiers
  status wait();
  void terminate();

  // queries
  const char* get(const std::string&) const;
  pipe_sink stdin_sink();
  pipe_source stdout_source();
  pipe_source stderr_source();
};

Description

child construct/copy/destruct

  1. child(const std::string& path, const std::vector<std::string>& args, 
          const environment& env, const context& ctx = context());
    Effects: パスpathで示される実行ファイルを引数args、環境変数envで実行する。標準入出力と作業ディレクトリはctxに従う。
  2. child(const std::string& path, const std::vector<std::string>& args, 
          const context& ctx = context());
    Effects: パスpathで示される実行ファイルを引数argsで実行する。標準入出力と作業ディレクトリはctxに従う。
    Notes: POSIX環境では、このコンストラクタの呼び出し中に環境変数を変更してはならない。
  3. child(const std::string& path, const environment& env, 
          const context& ctx = context());
    Effects: パスpathで示される実行ファイルを環境変数envで実行する。標準入出力と作業ディレクトリはctxに従う。
  4. child(const std::string& path, const context& ctx = context());
    Effects: パスpathで示される実行ファイルを実行する。標準入出力と作業ディレクトリはctxに従う。
    Notes: POSIX環境では、このコンストラクタの呼び出し中に環境変数を変更してはならない。

child modifiers

  1. status wait();
    Effects: 子プロセスの終了を待ち、終了状態を返す
  2. void terminate();
    Effects: 子プロセスを強制終了させる
    Notes: この関数は子プロセスに終了を促すだけで、実際に終了するまで待つことはない。

child queries

  1. const char* get(const std::string& name) const;
    Returns: nameのエントリがあればその値、なければ0
  2. pipe_sink stdin_sink();
    Returns: 子プロセスの標準入力に接続されたパイプ
  3. pipe_source stdout_source();
    Returns: 子プロセスの標準出力に接続されたパイプ
  4. pipe_source stderr_source();
    Returns: 子プロセスの標準エラー出力に接続されたパイプ
製作著作 © 2007 Takeshi Mouri

前のページ 上に戻る ホーム 次のページ