9#ifndef LLDB_CORE_PROGRESS_H
10#define LLDB_CORE_PROGRESS_H
15#include "llvm/ADT/StringMap.h"
89 Progress(std::string title, std::string details = {},
90 std::optional<uint64_t> total = std::nullopt,
92 Timeout<std::nano> minimum_report_time = std::nullopt,
113 std::optional<std::string> updated_detail = {});
120 std::chrono::milliseconds(20);
124 static std::atomic<uint64_t>
g_id;
A class to manage flag bits.
const Timeout< std::nano > m_minimum_report_time
const std::optional< lldb::user_id_t > m_debugger_id
The optional debugger ID to report progress to.
const std::string m_title
The title of the progress activity, also used as a category.
void Increment(uint64_t amount=1, std::optional< std::string > updated_detail={})
Increment the progress and send a notification to the installed callback.
static std::atomic< uint64_t > g_id
static constexpr std::chrono::milliseconds kDefaultHighFrequencyReportTime
The default report time for high frequency progress reports.
const Origin m_origin
The origin of the progress event, whether it is internal or external.
std::atomic< uint64_t > m_last_report_time_ns
Time (in nanoseconds since epoch) of the last progress report.
std::string m_details
More specific information about the current file being displayed in the report.
Origin
Enum to indicate the origin of a progress event, internal or external.
static constexpr uint64_t kNonDeterministicTotal
Used to indicate a non-deterministic progress report.
std::mutex m_mutex
Guards non-const non-atomic members of the class.
const uint64_t m_progress_id
A unique integer identifier for progress reporting.
std::atomic< uint64_t > m_completed
How much work ([0...m_total]) that has been completed.
std::optional< uint64_t > m_prev_completed
The "completed" value of the last reported event.
Progress(std::string title, std::string details={}, std::optional< uint64_t > total=std::nullopt, lldb_private::Debugger *debugger=nullptr, Timeout< std::nano > minimum_report_time=std::nullopt, Origin origin=Origin::eInternal)
Construct a progress object that will report information.
~Progress()
Destroy the progress object.
const uint64_t m_total
Total amount of work, use a std::nullopt in the constructor for non deterministic progress.
A class that represents a running process on the host machine.