21#ifndef ORES_QT_EVENT_VIEWER_WINDOW_HPP
22#define ORES_QT_EVENT_VIEWER_WINDOW_HPP
29#include <QAbstractTableModel>
30#include "ores.eventing/service/event_bus.hpp"
31#include "ores.logging/make_logger.hpp"
70 [[nodiscard]]
int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
71 [[nodiscard]]
int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
72 [[nodiscard]] QVariant data(
const QModelIndex& index,
73 int role = Qt::DisplayRole)
const override;
74 [[nodiscard]] QVariant headerData(
int section, Qt::Orientation orientation,
75 int role = Qt::DisplayRole)
const override;
79 [[nodiscard]]
const EventRecord& eventAt(
int row)
const;
80 [[nodiscard]]
int eventCount()
const {
return static_cast<int>(events_.size()); }
83 std::deque<EventRecord> events_;
84 static constexpr int max_events_ = 1000;
104 inline static std::string_view logger_name =
"ores.qt.event_viewer_window";
106 [[nodiscard]]
static auto& lg() {
108 static auto instance = make_logger(logger_name);
121 std::shared_ptr<eventing::service::event_bus> eventBus,
123 QWidget* parent =
nullptr);
128 void showEvent(QShowEvent* event)
override;
129 void closeEvent(QCloseEvent* event)
override;
132 void onEventDoubleClicked(
const QModelIndex& index);
133 void onClearClicked();
134 void onNotificationReceived(
const QString& eventType,
135 const QDateTime& timestamp,
136 const QStringList& entityIds);
140 void subscribeToEvents();
141 void unsubscribeFromEvents();
148 std::shared_ptr<eventing::service::event_bus> eventBus_;
152 QTableView* tableView_;
154 QLabel* statusLabel_;
155 QPushButton* clearButton_;
158 std::vector<eventing::service::subscription> subscriptions_;
161 bool connectedToClientManager_{
false};
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90
Record of a single event for display in the viewer.
Definition EventViewerDialog.hpp:45
Table model for displaying event records.
Definition EventViewerDialog.hpp:56
MDI window for viewing domain events in real-time.
Definition EventViewerDialog.hpp:100