Doxygen generated by local qwen3-coder-next
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
/*! \file pibinarylog.h
|
||||
* \ingroup IO
|
||||
* \~\brief
|
||||
* \~english Binary log
|
||||
* \~russian Бинарный лог
|
||||
*/
|
||||
//! \addtogroup IO
|
||||
//! \{
|
||||
//! \file pibinarylog.h
|
||||
//! \brief
|
||||
//! \~english Binary log
|
||||
//! \~russian Бинарный лог
|
||||
//! \details
|
||||
//! \~english Class for writing and reading binary data to/from log files, with support for playback in different modes
|
||||
//! \~russian Класс для записи и чтения бинарных данных в/из файлов логов с поддержкой воспроизведения в различных режимах
|
||||
//! \~\}
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Class for write binary data to logfile, and read or playback this data
|
||||
@@ -29,10 +33,8 @@
|
||||
#include "pichunkstream.h"
|
||||
#include "pifile.h"
|
||||
|
||||
//! \ingroup IO
|
||||
//! \~\brief
|
||||
//! \~english Binary log
|
||||
//! \~russian Бинарный лог
|
||||
//! \~english Class for writing and reading binary data to/from log files, with support for playback in different modes
|
||||
//! \~russian Класс для записи и чтения бинарных данных в/из файлов логов с поддержкой воспроизведения в различных режимах
|
||||
class PIP_EXPORT PIBinaryLog: public PIIODevice {
|
||||
PIIODEVICE(PIBinaryLog, "binlog");
|
||||
|
||||
@@ -40,94 +42,147 @@ public:
|
||||
explicit PIBinaryLog();
|
||||
virtual ~PIBinaryLog();
|
||||
|
||||
//! \brief Play modes for \a PIBinaryLog
|
||||
enum PlayMode {
|
||||
PlayRealTime /*! Play in system realtime, default mode */,
|
||||
PlayVariableSpeed /*! Play in software realtime with speed, set by \a setSpeed */,
|
||||
PlayStaticDelay /*! Play with custom static delay, ignoring timestamp */
|
||||
};
|
||||
//! \~english Play modes for \a PIBinaryLog
|
||||
//! \~russian Режимы воспроизведения для \a PIBinaryLog
|
||||
enum PlayMode {
|
||||
PlayRealTime /*! \~english Play in system realtime, default mode \~russian В системном реальном времени, режим по умолчанию */,
|
||||
PlayVariableSpeed /*! \~english Play in software realtime with speed, set by \a setSpeed \~russian В программном реальном времени со скоростью, задаваемой через \a setSpeed */,
|
||||
PlayStaticDelay /*! \~english Play with custom static delay, ignoring timestamp \~russian С пользовательской статической задержкой, игнорируя метку времени */
|
||||
};
|
||||
|
||||
//! \brief Different split modes for writing \a PIBinaryLog, which can separate files by size, by time or by records count
|
||||
enum SplitMode {
|
||||
SplitNone /*! Without separate, default mode */,
|
||||
SplitTime /*! Separate files by record time */,
|
||||
SplitSize /*! Separate files by size */,
|
||||
SplitCount /*! Separate files by records count */
|
||||
};
|
||||
//! \~english Different split modes for writing \a PIBinaryLog, which can separate files by size, by time or by records count
|
||||
//! \~russian Различные режимы разделения для записи \a PIBinaryLog, позволяющие разделять файлы по размеру, времени или количеству записей
|
||||
enum SplitMode {
|
||||
SplitNone /*! \~english Without separate, default mode \~russian Без разделения, режим по умолчанию */,
|
||||
SplitTime /*! \~english Separate files by record time \~russian Разделение файлов по времени записи */,
|
||||
SplitSize /*! \~english Separate files by size \~russian Разделение файлов по размеру */,
|
||||
SplitCount /*! \~english Separate files by records count \~russian Разделение файлов по количеству записей */
|
||||
};
|
||||
|
||||
#pragma pack(push, 8)
|
||||
|
||||
//! \brief Struct contains information about all records with same ID
|
||||
struct PIP_EXPORT BinLogRecordInfo {
|
||||
BinLogRecordInfo() {
|
||||
id = count = 0;
|
||||
minimum_size = maximum_size = 0;
|
||||
}
|
||||
int id;
|
||||
int count;
|
||||
int minimum_size;
|
||||
int maximum_size;
|
||||
PISystemTime start_time;
|
||||
PISystemTime end_time;
|
||||
};
|
||||
//! \~english Struct contains information about all records with same ID
|
||||
//! \~russian Структура содержит информацию обо всех записях с одинаковым ID
|
||||
struct PIP_EXPORT BinLogRecordInfo {
|
||||
//! \~english Constructor, initializes all fields to zero
|
||||
//! \~russian Конструктор, инициализирует все поля нулями
|
||||
BinLogRecordInfo() {
|
||||
id = count = 0;
|
||||
minimum_size = maximum_size = 0;
|
||||
}
|
||||
//! \~english Record ID
|
||||
//! \~russian ID записи
|
||||
int id;
|
||||
//! \~english Records count
|
||||
//! \~russian Количество записей
|
||||
int count;
|
||||
//! \~english Minimum record size
|
||||
//! \~russian Минимальный размер записи
|
||||
int minimum_size;
|
||||
//! \~english Maximum record size
|
||||
//! \~russian Максимальный размер записи
|
||||
int maximum_size;
|
||||
//! \~english Start time of records
|
||||
//! \~russian Время начала записей
|
||||
PISystemTime start_time;
|
||||
//! \~english End time of records
|
||||
//! \~russian Время окончания записей
|
||||
PISystemTime end_time;
|
||||
};
|
||||
|
||||
//! \brief Struct contains position, ID and timestamp of record in file
|
||||
struct PIP_EXPORT BinLogIndex {
|
||||
int id;
|
||||
int data_size;
|
||||
llong pos;
|
||||
PISystemTime timestamp;
|
||||
};
|
||||
//! \~english Struct contains position, ID and timestamp of record in file
|
||||
//! \~russian Структура содержит позицию, ID и метку времени записи в файле
|
||||
struct PIP_EXPORT BinLogIndex {
|
||||
//! \~english Record ID
|
||||
//! \~russian ID записи
|
||||
int id;
|
||||
//! \~english Data size
|
||||
//! \~russian Размер данных
|
||||
int data_size;
|
||||
//! \~english Position in file
|
||||
//! \~russian Позиция в файле
|
||||
llong pos;
|
||||
//! \~english Timestamp
|
||||
//! \~russian Метка времени
|
||||
PISystemTime timestamp;
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
//! \brief Struct contains full information about Binary Log file and about all Records using map of \a BinLogRecordInfo
|
||||
struct PIP_EXPORT BinLogInfo {
|
||||
PIString path;
|
||||
int records_count = 0;
|
||||
llong log_size = 0L;
|
||||
PISystemTime start_time;
|
||||
PISystemTime end_time;
|
||||
PIMap<int, BinLogRecordInfo> records;
|
||||
PIByteArray user_header;
|
||||
};
|
||||
//! \~english Struct contains full information about Binary Log file and about all Records using map of \a BinLogRecordInfo
|
||||
//! \~russian Структура содержит полную информацию о файле бинарного лога и обо всех записях с использованием карты \a BinLogRecordInfo
|
||||
struct PIP_EXPORT BinLogInfo {
|
||||
//! \~english Path to the log file
|
||||
//! \~russian Путь к файлу лога
|
||||
PIString path;
|
||||
//! \~english Total records count
|
||||
//! \~russian Общее количество записей
|
||||
int records_count = 0;
|
||||
//! \~english Log file size
|
||||
//! \~russian Размер файла лога
|
||||
llong log_size = 0L;
|
||||
//! \~english Start time of logging
|
||||
//! \~russian Время начала логирования
|
||||
PISystemTime start_time;
|
||||
//! \~english End time of logging
|
||||
//! \~russian Время окончания логирования
|
||||
PISystemTime end_time;
|
||||
//! \~english Map of record information by ID
|
||||
//! \~russian Карта информации о записях по ID
|
||||
PIMap<int, BinLogRecordInfo> records;
|
||||
//! \~english User-defined header data
|
||||
//! \~russian Пользовательские данные заголовка
|
||||
PIByteArray user_header;
|
||||
};
|
||||
|
||||
|
||||
//! Current \a PlayMode
|
||||
PlayMode playMode() const { return play_mode; }
|
||||
//! \~english Returns current \a PlayMode
|
||||
//! \~russian Возвращает текущий \a PlayMode
|
||||
PlayMode playMode() const { return play_mode; }
|
||||
|
||||
//! Current \a SplitMode
|
||||
SplitMode splitMode() const { return split_mode; }
|
||||
//! \~english Returns current \a SplitMode
|
||||
//! \~russian Возвращает текущий \a SplitMode
|
||||
SplitMode splitMode() const { return split_mode; }
|
||||
|
||||
//! Current directory where billogs wiil be saved
|
||||
PIString logDir() const { return property("logDir").toString(); }
|
||||
//! \~english Returns current directory where binlogs will be saved
|
||||
//! \~russian Возвращает текущий каталог, куда будут сохраняться бинарные логи
|
||||
PIString logDir() const { return property("logDir").toString(); }
|
||||
|
||||
//! Returns current file prefix
|
||||
PIString filePrefix() const { return property("filePrefix").toString(); }
|
||||
//! \~english Returns current file prefix
|
||||
//! \~russian Возвращает текущий префикс файла
|
||||
PIString filePrefix() const { return property("filePrefix").toString(); }
|
||||
|
||||
//! Default ID, used in \a write function
|
||||
int defaultID() const { return default_id; }
|
||||
//! \~english Returns default ID, used in \a write function
|
||||
//! \~russian Возвращает ID по умолчанию, используемый в функции \a write
|
||||
int defaultID() const { return default_id; }
|
||||
|
||||
//! Returns current play speed
|
||||
double playSpeed() const { return play_speed > 0 ? 1. / play_speed : 0.; }
|
||||
//! \~english Returns current play speed
|
||||
//! \~russian Возвращает текущую скорость воспроизведения
|
||||
double playSpeed() const { return play_speed > 0 ? 1. / play_speed : 0.; }
|
||||
|
||||
//! Returns current play delay
|
||||
PISystemTime playDelay() const { return play_delay; }
|
||||
//! \~english Returns current play delay
|
||||
//! \~russian Возвращает текущую задержку воспроизведения
|
||||
PISystemTime playDelay() const { return play_delay; }
|
||||
|
||||
//! Returns current binlog file split time
|
||||
PISystemTime splitTime() const { return split_time; }
|
||||
//! \~english Returns current binlog file split time
|
||||
//! \~russian Возвращает текущее время разделения файла бинарного лога
|
||||
PISystemTime splitTime() const { return split_time; }
|
||||
|
||||
//! Returns current binlog file split size
|
||||
llong splitFileSize() const { return split_size; }
|
||||
//! \~english Returns current binlog file split size
|
||||
//! \~russian Возвращает текущий размер разделения файла бинарного лога
|
||||
llong splitFileSize() const { return split_size; }
|
||||
|
||||
//! Returns current binlog file split records count
|
||||
int splitRecordCount() const { return split_count; }
|
||||
//! \~english Returns current binlog file split records count
|
||||
//! \~russian Возвращает текущее количество записей для разделения файла бинарного лога
|
||||
int splitRecordCount() const { return split_count; }
|
||||
|
||||
//! Returns if rapid start enabled
|
||||
bool rapidStart() const { return rapid_start; }
|
||||
//! \~english Returns if rapid start enabled
|
||||
//! \~russian Возвращает, включено ли быстрое начало
|
||||
bool rapidStart() const { return rapid_start; }
|
||||
|
||||
//! Returns if index creates while writing
|
||||
bool createIndexOnFly() const { return create_index_on_fly; }
|
||||
//! \~english Returns if index creates while writing
|
||||
//! \~russian Возвращает, создается ли индекс во время записи
|
||||
bool createIndexOnFly() const { return create_index_on_fly; }
|
||||
|
||||
//! Create binlog file with Filename = path
|
||||
void createNewFile(const PIString & path);
|
||||
|
||||
Reference in New Issue
Block a user