20#ifndef ORES_QT_CLIENT_FEATURE_FLAG_MODEL_HPP
21#define ORES_QT_CLIENT_FEATURE_FLAG_MODEL_HPP
24#include <QFutureWatcher>
25#include <QAbstractTableModel>
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.variability/domain/feature_flags.hpp"
44 inline static std::string_view logger_name =
45 "ores.qt.client_feature_flag_model";
47 [[nodiscard]]
static auto& lg() {
49 static auto instance = make_logger(logger_name);
67 QObject* parent =
nullptr);
71 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
72 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
73 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
74 QVariant headerData(
int section, Qt::Orientation orientation,
75 int role = Qt::DisplayRole)
const override;
99 void loadError(
const QString& error_message,
const QString& details = {});
102 void onFeatureFlagsLoaded();
103 void onPulseStateChanged(
bool isOn);
104 void onPulsingComplete();
107 QVariant recency_foreground_color(
const std::string& name)
const;
111 std::vector<variability::domain::feature_flags> flags;
112 QString error_message;
113 QString error_details;
116 ClientManager* clientManager_;
117 std::vector<variability::domain::feature_flags> flags_;
118 QFutureWatcher<FetchResult>* watcher_;
119 bool is_fetching_{
false};
122 RecencyTracker<variability::domain::feature_flags, FeatureFlagKeyExtractor> recencyTracker_;
123 RecencyPulseManager* pulseManager_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Model for displaying feature flags fetched from the server.
Definition ClientFeatureFlagModel.hpp:40
void refresh()
Refresh feature flag data from server asynchronously.
Definition ClientFeatureFlagModel.cpp:127
void dataLoaded()
Emitted when data has been successfully loaded.
const variability::domain::feature_flags * getFeatureFlag(int row) const
Get feature flag at the specified row.
Definition ClientFeatureFlagModel.cpp:232
void loadError(const QString &error_message, const QString &details={})
Emitted when an error occurs during data loading.
Column
Enumeration of table columns for type-safe column access.
Definition ClientFeatureFlagModel.hpp:57
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90
Represents a feature flag in the domain layer.
Definition feature_flags.hpp:31