20#ifndef ORES_QT_CLIENT_OVERNIGHT_INDEX_CONVENTION_MODEL_HPP
21#define ORES_QT_CLIENT_OVERNIGHT_INDEX_CONVENTION_MODEL_HPP
24#include <QFutureWatcher>
25#include "ores.qt/AbstractClientModel.hpp"
26#include "ores.qt/ClientManager.hpp"
27#include "ores.qt/RecencyPulseManager.hpp"
28#include "ores.qt/RecencyTracker.hpp"
29#include "ores.logging/make_logger.hpp"
30#include "ores.refdata.api/domain/overnight_index_convention.hpp"
44 inline static std::string_view logger_name =
45 "ores.qt.client_overnight_index_convention_model";
47 [[nodiscard]]
static auto& lg() {
49 static auto instance = make_logger(logger_name);
69 QObject* parent =
nullptr);
73 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
74 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
75 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
76 QVariant headerData(
int section, Qt::Orientation orientation,
77 int role = Qt::DisplayRole)
const override;
95 void load_page(std::uint32_t offset, std::uint32_t limit);
113 void onConventionsLoaded();
114 void onPulseStateChanged(
bool isOn);
115 void onPulsingComplete();
118 QVariant recency_foreground_color(
const std::string& code)
const;
122 std::vector<refdata::domain::overnight_index_convention> overnight_index_conventions;
123 std::uint32_t total_available_count;
124 QString error_message;
125 QString error_details;
128 void fetch_overnight_index_conventions(std::uint32_t offset, std::uint32_t limit);
130 ClientManager* clientManager_;
131 std::vector<refdata::domain::overnight_index_convention> overnight_index_conventions_;
132 QFutureWatcher<FetchResult>* watcher_;
133 std::uint32_t page_size_{100};
134 std::uint32_t total_available_count_{0};
135 bool is_fetching_{
false};
138 RecencyTracker<refdata::domain::overnight_index_convention, OvernightIndexConventionKeyExtractor> recencyTracker_;
139 RecencyPulseManager* pulseManager_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AccountController.hpp:32
Base class for all client-side entity models.
Definition AbstractClientModel.hpp:37
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:123
Model for displaying overnight index conventions fetched from the server.
Definition ClientOvernightIndexConventionModel.hpp:40
void set_page_size(std::uint32_t size)
Set the page size for pagination.
Definition ClientOvernightIndexConventionModel.cpp:261
void refresh()
Refresh overnight index convention data from server asynchronously.
Definition ClientOvernightIndexConventionModel.cpp:131
std::uint32_t total_available_count() const
Get the total number of records available on the server.
Definition ClientOvernightIndexConventionModel.hpp:110
const refdata::domain::overnight_index_convention * getConvention(int row) const
Get overnight index convention at the specified row.
Definition ClientOvernightIndexConventionModel.cpp:273
void load_page(std::uint32_t offset, std::uint32_t limit)
Load a specific page of data.
Definition ClientOvernightIndexConventionModel.cpp:157
std::uint32_t page_size() const
Get the page size used for pagination.
Definition ClientOvernightIndexConventionModel.hpp:100
Column
Enumeration of table columns for type-safe column access.
Definition ClientOvernightIndexConventionModel.hpp:57
Conventions for an overnight index (e.g. EONIA, SONIA, SOFR).
Definition overnight_index_convention.hpp:36