10#ifndef __UTILS_PROGRESS_INFO_H__
11#define __UTILS_PROGRESS_INFO_H__
18#include "utils/debug.h"
50 Status get_status ()
const {
return status_; };
52 CompletionType get_completion_type ()
const
54 z_return_val_if_fail (status_ == COMPLETED, HAS_ERROR);
55 return completion_type_;
78 std::scoped_lock guard (m_);
80 return std::make_tuple (progress_, progress_str_);
88 bool pending_cancellation ()
const
90 return status_ == PENDING_CANCELLATION;
101 CompletionType completion_type_{};
105 utils::Utf8String completion_str_;
109 utils::Utf8String progress_str_;
std::tuple< double, utils::Utf8String > get_progress()
To be called by the task caller.
void mark_completed(CompletionType type, const utils::Utf8String &msg)
To be called by the task itself.
void request_cancellation()
To be called by the task caller.
utils::Utf8String get_message() const
Returns a newly allocated string.
void update_progress(double progress, const utils::Utf8String &msg)
To be called by the task itself.
Lightweight UTF-8 string wrapper with safe conversions.