Skip to content
API Documentation
BastionGuard™
recovery_worker.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "models.hpp"
5
6#include <atomic>
7#include <functional>
8#include <string>
9#include <thread>
10#include <vector>
11
13 bool ok {false};
15 std::vector<std::string> logs;
16 std::string error;
17};
18
20public:
21 using CompletionCallback = std::function<void(const RecoveryResult&)>;
22
25
26 void start(const ScanReport& report,
27 const std::string& output_dir,
28 const std::vector<size_t>& selected_result_indices,
30 bool running() const;
31 void join();
32 std::atomic<bool> cancel_requested_{false};
33
34 void request_cancel();
35private:
36 std::atomic<bool> running_ {false};
37 std::thread thread_;
38};
void start(const ScanReport &report, const std::string &output_dir, const std::vector< size_t > &selected_result_indices, CompletionCallback cb)
std::atomic< bool > cancel_requested_
bool running() const
std::function< void(const RecoveryResult &)> CompletionCallback
std::thread thread_
std::atomic< bool > running_
RecoverySummary summary
std::vector< std::string > logs