#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/ProcessRunner.hpp>
Classes | |
| struct | OutputLine |
| struct | SyncResult |
Public Types | |
| using | OutputCallback = std::function<void(const std::vector<OutputLine>& lines)> |
| using | DoneCallback = std::function<void(int exit_code)> |
Public Member Functions | |
| ProcessRunner () | |
| ~ProcessRunner () override | |
| bool | run_command_line_async (const std::string &command_line, OutputCallback on_output, DoneCallback on_done) |
| void | write_stdin (const std::string &data) |
| bool | is_running () const |
| void | terminate () |
Static Public Member Functions | |
| static SyncResult | run_sync (const std::string &executable, const std::vector< std::string > &args) |
Private Member Functions | |
| void | on_timer (wxTimerEvent &event) |
| void | finish_process (int exit_code) |
| void | start_reader_threads () |
| void | join_reader_threads () |
| void | enqueue_output (std::string line, bool is_stderr) |
| std::vector< OutputLine > | drain_output_queue () |
| void | join_launch_thread () |
Private Attributes | |
| wxTimer | m_poll_timer |
| std::atomic_bool | m_launching {false} |
| std::atomic_bool | m_launch_failed {false} |
| std::thread | m_launch_thread |
| std::thread | m_stdout_thread |
| std::thread | m_stderr_thread |
| std::mutex | m_output_mutex |
| std::vector< OutputLine > | m_output_queue |
| std::unique_ptr< boost::process::child > | m_process |
| std::unique_ptr< boost::process::ipstream > | m_stdout_pipe |
| std::unique_ptr< boost::process::ipstream > | m_stderr_pipe |
| std::unique_ptr< boost::process::opstream > | m_stdin_pipe |
| OutputCallback | m_on_output |
| DoneCallback | m_on_done |
| struct Slic3r::GUI::ProcessRunner::OutputLine |
| struct Slic3r::GUI::ProcessRunner::SyncResult |
| using Slic3r::GUI::ProcessRunner::DoneCallback = std::function<void(int exit_code)> |
| using Slic3r::GUI::ProcessRunner::OutputCallback = std::function<void(const std::vector<OutputLine>& lines)> |
| Slic3r::GUI::ProcessRunner::ProcessRunner | ( | ) |
References m_poll_timer, and on_timer().
|
override |
|
private |
References m_output_mutex, and m_output_queue.
Referenced by finish_process(), on_timer(), and run_command_line_async().
|
private |
References m_output_mutex, and m_output_queue.
Referenced by start_reader_threads().
|
private |
References drain_output_queue(), join_launch_thread(), join_reader_threads(), m_on_done, m_on_output, m_process, m_stderr_pipe, m_stdin_pipe, and m_stdout_pipe.
Referenced by on_timer(), and terminate().
| bool Slic3r::GUI::ProcessRunner::is_running | ( | ) | const |
References m_launching, and m_process.
Referenced by run_command_line_async().
|
private |
References m_launch_thread.
Referenced by finish_process(), on_timer(), run_command_line_async(), and terminate().
|
private |
References m_stderr_thread, and m_stdout_thread.
Referenced by finish_process(), and start_reader_threads().
|
private |
References drain_output_queue(), finish_process(), join_launch_thread(), m_launch_failed, m_launching, m_on_output, m_poll_timer, and m_process.
Referenced by ProcessRunner().
| bool Slic3r::GUI::ProcessRunner::run_command_line_async | ( | const std::string & | command_line, |
| OutputCallback | on_output, | ||
| DoneCallback | on_done ) |
References drain_output_queue(), is_running(), join_launch_thread(), m_launch_failed, m_launch_thread, m_launching, m_on_done, m_on_output, m_poll_timer, m_process, m_stderr_pipe, m_stdin_pipe, m_stdout_pipe, and start_reader_threads().
|
static |
References Slic3r::GUI::ProcessRunner::SyncResult::exit_code, Slic3r::GUI::ProcessRunner::SyncResult::stderr_output, and Slic3r::GUI::ProcessRunner::SyncResult::stdout_output.
|
private |
References enqueue_output(), join_reader_threads(), m_stderr_pipe, m_stderr_thread, m_stdout_pipe, and m_stdout_thread.
Referenced by run_command_line_async().
| void Slic3r::GUI::ProcessRunner::terminate | ( | ) |
References finish_process(), join_launch_thread(), m_launch_failed, m_on_done, m_poll_timer, and m_process.
Referenced by ~ProcessRunner().
| void Slic3r::GUI::ProcessRunner::write_stdin | ( | const std::string & | data | ) |
References m_launching, m_process, and m_stdin_pipe.
|
private |
Referenced by on_timer(), run_command_line_async(), and terminate().
|
private |
Referenced by join_launch_thread(), and run_command_line_async().
|
private |
Referenced by is_running(), on_timer(), run_command_line_async(), and write_stdin().
|
private |
Referenced by finish_process(), run_command_line_async(), and terminate().
|
private |
Referenced by finish_process(), on_timer(), and run_command_line_async().
|
private |
Referenced by drain_output_queue(), and enqueue_output().
|
private |
Referenced by drain_output_queue(), and enqueue_output().
|
private |
Referenced by ProcessRunner(), on_timer(), run_command_line_async(), and terminate().
|
private |
Referenced by finish_process(), is_running(), on_timer(), run_command_line_async(), terminate(), and write_stdin().
|
private |
Referenced by finish_process(), run_command_line_async(), and start_reader_threads().
|
private |
Referenced by join_reader_threads(), and start_reader_threads().
|
private |
Referenced by finish_process(), run_command_line_async(), and write_stdin().
|
private |
Referenced by finish_process(), run_command_line_async(), and start_reader_threads().
|
private |
Referenced by join_reader_threads(), and start_reader_threads().