![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
One invocation: the argument vector, plus what a pipe would have carried. More...
#include <line/cli/cli_run.h>
Public Attributes | |
| std::vector< std::string > | argv |
| The argument vector WITHOUT argv[0], e.g. | |
| std::string | stdin_text |
| The model document, as if piped to the binary's stdin. | |
| bool | has_stdin = false |
| bool | collect_json = true |
| Collect the JSON documents as they are emitted. | |
| bool | capture_stdout = true |
| Redirect fd 1 for the duration of the call into Response::text. | |
| bool | capture_stderr = true |
| Redirect fd 2 for the duration of the call into Response::diagnostics. | |
| bool | allow_server = false |
| Permit -p, which serves until its request budget is exhausted. | |
| int(*) | interrupt (void *user) = nullptr |
| Polled between analyses and at each document emission; non-zero aborts. | |
| void * | interrupt_user = nullptr |
One invocation: the argument vector, plus what a pipe would have carried.
| bool line::cli::Request::allow_server = false |
Permit -p, which serves until its request budget is exhausted.
OFF BY DEFAULT because a host that passes a user's argument string through would otherwise hand that user a way to block the calling thread indefinitely and open a listening socket. It is a capability, not a safety check: a caller who means it says so.
Definition at line 81 of file cli_run.h.
Referenced by line::cli::run().
| std::vector<std::string> line::cli::Request::argv |
The argument vector WITHOUT argv[0], e.g.
{"-f", "m.json", "-s", "mva"}. A leading program name is not expected and would be parsed as a stray positional argument.
Definition at line 55 of file cli_run.h.
Referenced by line::cli::run().
| bool line::cli::Request::capture_stderr = true |
Redirect fd 2 for the duration of the call into Response::diagnostics.
Definition at line 72 of file cli_run.h.
Referenced by line::cli::run().
| bool line::cli::Request::capture_stdout = true |
Redirect fd 1 for the duration of the call into Response::text.
Definition at line 70 of file cli_run.h.
Referenced by line::cli::run().
| bool line::cli::Request::collect_json = true |
Collect the JSON documents as they are emitted.
Definition at line 68 of file cli_run.h.
Referenced by line::cli::run().
| bool line::cli::Request::has_stdin = false |
Definition at line 65 of file cli_run.h.
Referenced by line::cli::run().
| int(*) line::cli::Request::interrupt(void *user) = nullptr |
Polled between analyses and at each document emission; non-zero aborts.
A HOST CANNOT SIMPLY LONGJMP OUT OF HERE. R's R_CheckUserInterrupt does exactly that, and doing it from a frame with C++ destructors above it skips every one of them, leaking the capture's file descriptors and its temporary files. So the host polls its own flag inside this callback and says so by return value, and the abort unwinds normally.
WHERE IT IS POLLED IS DELIBERATELY NARROW, and saying so is the point: a half-working interrupt that is advertised as working is worse than none. It fires between the analyses of a comma-separated -a list and at each JSON emission. It does NOT reach inside one long solve, because the solver loops take no callback and threading one through them is an engine-wide change this seam has no business making.
Definition at line 99 of file cli_run.h.
Referenced by line::cli::run().
| void* line::cli::Request::interrupt_user = nullptr |
Definition at line 100 of file cli_run.h.
Referenced by line::cli::run().
| std::string line::cli::Request::stdin_text |
The model document, as if piped to the binary's stdin.
has_stdin rather than an empty check, because an empty document is a legitimate thing to hand the reader and must produce the reader's own refusal rather than a read from the host's real stdin.
Definition at line 64 of file cli_run.h.
Referenced by line::cli::run().