10#ifndef __UTILS_PROGRESS_INFO_H__
11#define __UTILS_PROGRESS_INFO_H__
18#include "utils/debug.h"
51 Status get_status ()
const {
return status_; };
53 CompletionType get_completion_type ()
const
55 z_return_val_if_fail (status_ == COMPLETED, HAS_ERROR);
56 return completion_type_;
79 std::scoped_lock guard (m_);
81 return std::make_tuple (progress_, progress_str_);
89 bool pending_cancellation ()
const
91 return status_ == PENDING_CANCELLATION;
102 CompletionType completion_type_{};
106 utils::Utf8String completion_str_;
110 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.