ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
ClientResultModel Class Referencefinal

Model for displaying compute results fetched from the server. More...

#include <ClientResultModel.hpp>

Inheritance diagram for ClientResultModel:
Inheritance graph
Collaboration diagram for ClientResultModel:
Collaboration graph

Public Types

enum  Column {
  WorkunitId , HostId , ServerState , Outcome ,
  ErrorMessage , OutputUri , ReceivedAt , Version ,
  ModifiedBy , ColumnCount
}
 Enumeration of table columns for type-safe column access.
 

Public Member Functions

 ClientResultModel (ClientManager *clientManager, QObject *parent=nullptr)
 
void set_host_name_cache (HostDisplayNameCache *cache)
 Sets the host display-name cache used to render the Host column.
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
void refresh ()
 Refresh compute result data from server asynchronously.
 
const compute::domain::resultgetResult (int row) const
 Get compute result at the specified row.
 
void load_page (std::uint32_t offset, std::uint32_t limit)
 Load a specific page of data.
 
std::uint32_t page_size () const
 Get the page size used for pagination.
 
void set_page_size (std::uint32_t size)
 Set the page size for pagination.
 
std::uint32_t total_available_count () const
 Get the total number of records available on the server.
 

Additional Inherited Members

- Signals inherited from AbstractClientModel
void dataLoaded ()
 
void loadError (const QString &error_message, const QString &details={})
 

Detailed Description

Model for displaying compute results fetched from the server.

This model extends QAbstractTableModel and fetches compute result data asynchronously using the ores.comms client.

Member Function Documentation

◆ set_host_name_cache()

void set_host_name_cache ( HostDisplayNameCache cache)

Sets the host display-name cache used to render the Host column.

The cache is not owned by this model. Pass nullptr to revert to raw UUID.

◆ getResult()

const compute::domain::result * getResult ( int  row) const

Get compute result at the specified row.

Parameters
rowThe row index.
Returns
The compute result, or nullptr if row is invalid.