![]() |
bob.hpp
|
A class for running many commands in parallel. More...
#include <bob.hpp>
Public Member Functions | |
CmdRunner (size_t process_count) | |
Create a CmdRunner with a specified number of processes. | |
CmdRunner (vector< Cmd > cmds) | |
CmdRunner (vector< Cmd > cmds, size_t process_count) | |
CmdRunner () | |
size_t | size () |
Returns the number of commands in the runner. | |
void | push (Cmd cmd) |
Push a single command to the runner. | |
void | push_many (vector< Cmd > cmds) |
Push multiple commands to the runner. | |
void | clear () |
Clears all commands in the runner for reuse. | |
bool | run () |
Runs all commands in the runner concurrently. | |
bool | all_succeded () |
Returns true if all commands in the runner succeeded (exit code 0). | |
bool | any_failed () |
Returns true if any command in the runner failed (non-zero exit code). | |
void | print_failed () |
Prints the output of all commands that failed. | |
void | capture_output (bool capture=true) |
Sets the capture_output flag for all commands in the runner. | |
Public Attributes | |
vector< Cmd > | cmds |
The commands to be run by this runner. | |
vector< int > | exit_codes |
Exit codes for each command in cmds . | |
A class for running many commands in parallel.
bob::CmdRunner::CmdRunner | ( | vector< Cmd > | cmds | ) |
Create a CmdRunner
with a list of commands.
The process count is the thread count of the current processor
bob::CmdRunner::CmdRunner | ( | vector< Cmd > | cmds, |
size_t | process_count | ||
) |
Create a CmdRunner
with a list of commands and a maximum number of simultaneous processes.
bob::CmdRunner::CmdRunner | ( | ) |
Create an empty CmdRunner
.
The process count is the thread count of the current processor