20#ifndef ORES_QT_COMPUTE_TASK_VIEW_MODEL_HPP
21#define ORES_QT_COMPUTE_TASK_VIEW_MODEL_HPP
24#include <QFutureWatcher>
25#include <QAbstractTableModel>
26#include "ores.qt/AbstractClientModel.hpp"
27#include "ores.qt/ClientManager.hpp"
28#include "ores.qt/HostDisplayNameCache.hpp"
29#include "ores.logging/make_logger.hpp"
30#include "ores.compute.api/domain/batch.hpp"
31#include "ores.compute.api/domain/workunit.hpp"
32#include "ores.compute.api/domain/result.hpp"
58 inline static std::string_view logger_name =
59 "ores.qt.compute_task_view_model";
61 [[nodiscard]]
static auto& lg() {
63 static auto instance = make_logger(logger_name);
80 QObject* parent =
nullptr);
84 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
85 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
86 QVariant data(
const QModelIndex& index,
87 int role = Qt::DisplayRole)
const override;
88 QVariant headerData(
int section, Qt::Orientation orientation,
89 int role = Qt::DisplayRole)
const override;
107 void onTasksLoaded();
111 bool success =
false;
112 std::vector<compute_task> tasks;
113 QString error_message;
114 QString error_details;
121 std::vector<compute_task> tasks_;
122 QFutureWatcher<FetchResult>* watcher_;
123 bool is_fetching_{
false};
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
A logical grouping of workunits forming a financial computation batch.
Definition batch.hpp:35
A specific execution instance of a workunit assigned to a host.
Definition result.hpp:38
An abstract job template within a compute batch.
Definition workunit.hpp:36
Base class for all client-side entity models.
Definition AbstractClientModel.hpp:36
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
A joined view row: one result with its workunit and batch context.
Definition ComputeTaskViewModel.hpp:39
int batch_ordinal
1-based position in the loaded batch list
Definition ComputeTaskViewModel.hpp:43
int task_ordinal
1-based position within its batch
Definition ComputeTaskViewModel.hpp:44
Read-only table model that joins results, workunits, and batches.
Definition ComputeTaskViewModel.hpp:54
void refresh()
Fetch and join all batches, workunits, and results.
Definition ComputeTaskViewModel.cpp:163
void set_host_name_cache(HostDisplayNameCache *cache)
Sets the host display-name cache (not owned).
Definition ComputeTaskViewModel.cpp:297
const compute_task * get_task(int row) const
Returns the task at the given row, or nullptr if out of range.
Definition ComputeTaskViewModel.cpp:291
Shared cache mapping host UUID strings to whimsical display names.
Definition HostDisplayNameCache.hpp:41