merged AI doc, some new pages

This commit is contained in:
2026-03-12 14:46:57 +03:00
parent 07ae277f9e
commit ed13838237
206 changed files with 14088 additions and 5152 deletions

View File

@@ -1,9 +1,15 @@
/*! \file pimemoryblock.h
* \ingroup Core
* \~\brief
* \~english Base types and functions
* \~russian Базовые типы и методы
*/
//! \~\ingroup Core
//! \~\file pimemoryblock.h
//! \brief
//! \~english Memory block helper struct for data storage and binary stream operations
//! \~russian Вспомогательная структура памяти для хранения данных и операций с двоичным потоком
//! \details
//! \~english The PIMemoryBlock struct provides a lightweight wrapper to store and restore custom blocks of data to/from PIBinaryStream. It
//! holds a pointer to data and its size in bytes.
//! \~russian Структура PIMemoryBlock предоставляет легковесный wrapper для сохранения и извлечения произвольных блоков данных в/из
//! PIBinaryStream. Она содержит указатель на данные и их размер в байтах.
/*
PIP - Platform Independent Primitives
Base types and functions
@@ -27,49 +33,52 @@
#define PIMEMORYBLOCK_H
//! \ingroup Core
//! \include pimemoryblock.h
//! \brief
//! \~english Help struct to store/restore custom blocks of data to/from PIBinaryStream
//! \~russian Вспомогательная структура для сохранения/извлечения произвольного блока данных в/из PIBinaryStream
//! \~\brief
//! \~english Helper struct to store and restore custom blocks of data to/from PIBinaryStream
//! \~russian Вспомогательная структура для сохранения и извлечения произвольных блоков данных в/из PIBinaryStream
struct PIMemoryBlock {
public:
//! \~english Constructs data block
//! \~russian Создает блок данных
//! \~english Constructs empty memory block.
//! \~russian Создает пустой блок памяти.
PIMemoryBlock() {}
//! \~english Constructs data block
//! \~russian Создает блок данных
//! \~english Constructs memory block from pointer and size.
//! \~russian Создает блок памяти из указателя и размера.
PIMemoryBlock(const void * data_, const int size_) {
d = const_cast<void *>(data_);
s = size_;
}
//! \~english Copy constructor.
//! \~russian Конструктор копирования.
PIMemoryBlock(const PIMemoryBlock & o) {
d = o.d;
s = o.s;
}
//! \~english Copy assignment operator.
//! \~russian Оператор присваивания копированием.
PIMemoryBlock & operator=(const PIMemoryBlock & o) {
d = o.d;
s = o.s;
return *this;
}
//! \~english Pointer to data
//! \~russian Указатель на данные
//! \~english Returns pointer to block data.
//! \~russian Возвращает указатель на данные блока.
void * data() { return d; }
//! \~english Pointer to data
//! \~russian Указатель на данные
//! \~english Returns pointer to block data.
//! \~russian Возвращает указатель на данные блока.
const void * data() const { return d; }
//! \~english Size of data in bytes
//! \~russian Размер данных в байтах
//! \~english Returns block size in bytes.
//! \~russian Возвращает размер блока в байтах.
int size() const { return s; }
//! \~english Returns if this block points to nothing
//! \~russian Возвращает пустой ли указатель на данные
//! \~english Returns `true` when the block stores a non-null pointer.
//! \~russian Возвращает `true`, когда блок хранит ненулевой указатель.
bool isNull() const { return d; }
private:
@@ -77,8 +86,10 @@ private:
int s = 0;
};
//! \~english Returns PIMemoryBlock from pointer to variable "ptr" with type "T"
//! \~russian Возвращает PIMemoryBlock из указателя "ptr" типа "T"
//! \~\ingroup Core
//! \~\brief
//! \~english Creates %PIMemoryBlock for object pointed by "ptr".
//! \~russian Создает %PIMemoryBlock для объекта, на который указывает "ptr".
template<typename T>
PIMemoryBlock createMemoryBlock(const T * ptr) {
return PIMemoryBlock(ptr, sizeof(T));