From 8e18ec15c9c0b18d0a40556fb0582fb921eace13 Mon Sep 17 00:00:00 2001 From: peri4 Date: Tue, 4 Mar 2025 20:20:09 +0300 Subject: [PATCH] add PIBinaryLog::threadedReadRecord event (with full info) --- libs/main/io_devices/pibinarylog.cpp | 4 +++- libs/main/io_devices/pibinarylog.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/main/io_devices/pibinarylog.cpp b/libs/main/io_devices/pibinarylog.cpp index 518dddcc..666ec901 100644 --- a/libs/main/io_devices/pibinarylog.cpp +++ b/libs/main/io_devices/pibinarylog.cpp @@ -181,6 +181,7 @@ bool PIBinaryLog::threadedRead(const uchar * readed, ssize_t size) { is_thread_ok = false; logmutex.lock(); const PISystemTime lastrec_timestamp = lastrecord.timestamp; + const int lastrec_id = lastrecord.id; logmutex.unlock(); PISystemTime pt; double delay; @@ -248,7 +249,8 @@ bool PIBinaryLog::threadedRead(const uchar * readed, ssize_t size) { break; default: return false; } - bool res = PIIODevice::threadedRead(readed, size); + bool res = PIIODevice::threadedRead(readed, size); + threadedReadRecord(PIByteArray(readed, size), lastrec_id, lastrec_timestamp); is_thread_ok = true; return res; } diff --git a/libs/main/io_devices/pibinarylog.h b/libs/main/io_devices/pibinarylog.h index 619c7ecc..03af587d 100644 --- a/libs/main/io_devices/pibinarylog.h +++ b/libs/main/io_devices/pibinarylog.h @@ -327,6 +327,7 @@ public: EVENT(fileError); EVENT1(newFile, const PIString &, filename); EVENT1(posChanged, int, pos); + EVENT3(threadedReadRecord, PIByteArray, data, int, id, PISystemTime, time); //! Get binlog info and statistic static BinLogInfo getLogInfo(const PIString & path);