#include <scan_worker.hpp>
Public Types | |
| using | CompletionCallback = std::function<void(const ScanReport&)> |
| using | ProgressCallback = std::function<void(const ScanProgress&)> |
Public Member Functions | |
| ScanWorker () | |
| ~ScanWorker () | |
| void | start (const std::string &path, CompletionCallback cb, ProgressCallback progress_cb={}) |
| bool | running () const |
| void | join () |
| void | request_cancel () |
| bool | cancel_requested () const |
Private Attributes | |
| std::atomic< bool > | running_ {false} |
| std::atomic< bool > | cancel_requested_ {false} |
| std::thread | thread_ |
Definition at line 9 of file scan_worker.hpp.
| using ScanWorker::CompletionCallback = std::function<void(const ScanReport&)> |
Definition at line 11 of file scan_worker.hpp.
| using ScanWorker::ProgressCallback = std::function<void(const ScanProgress&)> |
Definition at line 12 of file scan_worker.hpp.
|
default |
References ScanWorker(), and start().
Referenced by ScanWorker().
| ScanWorker::~ScanWorker | ( | ) |
Definition at line 8 of file scan_worker.cpp.
References join(), and request_cancel().
| bool ScanWorker::cancel_requested | ( | ) | const |
| void ScanWorker::join | ( | ) |
Definition at line 70 of file scan_worker.cpp.
References thread_.
Referenced by ~ScanWorker().
| void ScanWorker::request_cancel | ( | ) |
Definition at line 76 of file scan_worker.cpp.
References cancel_requested_.
Referenced by ~ScanWorker().
| bool ScanWorker::running | ( | ) | const |
Definition at line 65 of file scan_worker.cpp.
References running_.
Referenced by AppWindow::on_scan_clicked(), MainWindow::on_scan_now(), and MainWindow::update_action_controls().
| void ScanWorker::start | ( | const std::string & | path, |
| CompletionCallback | cb, | ||
| ProgressCallback | progress_cb = {} ) |
Definition at line 14 of file scan_worker.cpp.
References cancel_requested_, ScanReport::logs, ScannerEngine::run_scan(), running_, and thread_.
Referenced by AppWindow::on_scan_clicked(), MainWindow::on_scan_now(), and ScanWorker().
|
private |
Definition at line 30 of file scan_worker.hpp.
Referenced by cancel_requested(), request_cancel(), and start().
|
private |
Definition at line 29 of file scan_worker.hpp.
|
private |
Definition at line 32 of file scan_worker.hpp.