pages fix
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
|
||||
The Application module provides classes commonly needed at program startup and runtime:
|
||||
|
||||
* **\a PICLI** — command-line argument parser. Add named arguments (e.g. \c addArgument("debug") for \c -d / \c --debug), check presence with \a hasArgument(), optionally read values. Used in \ref using_basic for console and debug flags.
|
||||
* **\a PILog** — high-level logging with categories and levels. Configure sinks and severity; write log lines from anywhere in the process.
|
||||
* **\a PISystemMonitor** — snapshot of system resources (CPU, memory, etc.). Query current stats or subscribe to periodic updates.
|
||||
* **\a PISingleApplication** — ensure only one instance of the application runs; optional inter-process messaging when a second instance is started.
|
||||
* **\a PITranslator** — translation support: load catalogs, select language, translate strings at runtime.
|
||||
* **PICLI** — command-line argument parser. Add named arguments (e.g. \c addArgument("debug") for \c -d / \c --debug), check presence with \a hasArgument(), optionally read values. Used in \ref using_basic for console and debug flags.
|
||||
* **PILog** — high-level logging with categories and levels. Configure sinks and severity; write log lines from anywhere in the process.
|
||||
* **PISystemMonitor** — snapshot of system resources (CPU, memory, etc.). Query current stats or subscribe to periodic updates.
|
||||
* **PISingleApplication** — ensure only one instance of the application runs; optional inter-process messaging when a second instance is started.
|
||||
* **PITranslator** — translation support: load catalogs, select language, translate strings at runtime.
|
||||
|
||||
All are included via the main PIP library or the Application umbrella (\a piapplicationmodule.h). For CLI and logging, see \ref using_basic; for full API details see the headers \a picli.h, \a pilog.h, \a pisystemmonitor.h, \a pisingleapplication.h, \a pitranslator.h.
|
||||
|
||||
@@ -17,10 +17,10 @@ All are included via the main PIP library or the Application umbrella (\a piappl
|
||||
|
||||
Модуль Application предоставляет классы, часто нужные при запуске и работе приложения:
|
||||
|
||||
* **\a PICLI** — разбор аргументов командной строки. Добавление именованных аргументов (\c addArgument("debug") для \c -d / \c --debug), проверка наличия \a hasArgument(), при необходимости чтение значений. Используется в \ref using_basic для флагов консоли и отладки.
|
||||
* **\a PILog** — логирование с категориями и уровнями. Настройка приёмников и уровня детализации; запись строк лога из любой части процесса.
|
||||
* **\a PISystemMonitor** — снимок ресурсов системы (CPU, память и т.д.). Запрос текущей статистики или подписка на периодические обновления.
|
||||
* **\a PISingleApplication** — гарантия единственного экземпляра приложения; при необходимости обмен сообщениями между процессами при запуске второго экземпляра.
|
||||
* **\a PITranslator** — поддержка перевода: загрузка каталогов, выбор языка, перевод строк в runtime.
|
||||
* **PICLI** — разбор аргументов командной строки. Добавление именованных аргументов (\c addArgument("debug") для \c -d / \c --debug), проверка наличия \a hasArgument(), при необходимости чтение значений. Используется в \ref using_basic для флагов консоли и отладки.
|
||||
* **PILog** — логирование с категориями и уровнями. Настройка приёмников и уровня детализации; запись строк лога из любой части процесса.
|
||||
* **PISystemMonitor** — снимок ресурсов системы (CPU, память и т.д.). Запрос текущей статистики или подписка на периодические обновления.
|
||||
* **PISingleApplication** — гарантия единственного экземпляра приложения; при необходимости обмен сообщениями между процессами при запуске второго экземпляра.
|
||||
* **PITranslator** — поддержка перевода: загрузка каталогов, выбор языка, перевод строк в runtime.
|
||||
|
||||
Всё подключается через основную библиотеку PIP или зонтичный заголовок (\a piapplicationmodule.h). Для CLI и лога см. \ref using_basic; детали API — в заголовках \a picli.h, \a pilog.h, \a pisystemmonitor.h, \a pisingleapplication.h, \a pitranslator.h.
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
The Thread module provides threads, timers, synchronization primitives and task execution:
|
||||
|
||||
* **\a PIThread** — run a loop or one-off work in a separate thread. Override \a run() or use the default loop; start/stop with \a start() and \a stop(). Can act as the event performer for \a PIObject (see \ref using_advanced "Threading and events").
|
||||
* **\a PITimer** — periodic callbacks at a given frequency (e.g. Hz). Connect to a handler; start/stop the timer. Used in \ref using_basic and in state machine examples.
|
||||
* **PIThread** — run a loop or one-off work in a separate thread. Override \a run() or use the default loop; start/stop with \a start() and \a stop(). Can act as the event performer for \a PIObject (see \ref using_advanced "Threading and events").
|
||||
* **PITimer** — periodic callbacks at a given frequency (e.g. Hz). Connect to a handler; start/stop the timer. Used in \ref using_basic and in state machine examples.
|
||||
* **Synchronization** — \a PIMutex, \a PISpinlock, \a PIConditionVariable, \a PISemaphore, \a PIReadWriteLock for protecting shared data and coordinating threads.
|
||||
* **\a PIThreadPoolExecutor** — submit tasks to a fixed pool of worker threads; wait for completion or shutdown.
|
||||
* **\a PIThreadPoolLoop** — run a function over a range in parallel (parallel-for style).
|
||||
* **\a PIBlockingDequeue** — blocking producer-consumer queue for passing work between threads.
|
||||
* **PIThreadPoolExecutor** — submit tasks to a fixed pool of worker threads; wait for completion or shutdown.
|
||||
* **PIThreadPoolLoop** — run a function over a range in parallel (parallel-for style).
|
||||
* **PIBlockingDequeue** — blocking producer-consumer queue for passing work between threads.
|
||||
|
||||
Use \a PIMutexLocker (and similar guards) for exception-safe locking. Events from other threads can be queued and processed in the object's thread via \a callQueuedEvents() (see \ref PIObject_sec0). Full API: \a pithread.h, \a pitimer.h, \a pimutex.h, \a pithreadpoolexecutor.h, \a piblockingqueue.h, \a pithreadmodule.h.
|
||||
|
||||
@@ -18,11 +18,11 @@ Use \a PIMutexLocker (and similar guards) for exception-safe locking. Events fro
|
||||
|
||||
Модуль Thread предоставляет потоки, таймеры, примитивы синхронизации и выполнение задач:
|
||||
|
||||
* **\a PIThread** — выполнение цикла или разовой работы в отдельном потоке. Переопределение \a run() или использование цикла по умолчанию; запуск и остановка — \a start() и \a stop(). Может быть исполнителем событий для \a PIObject (см. \ref using_advanced "Потоки и события").
|
||||
* **\a PITimer** — периодические вызовы с заданной частотой (например в Гц). Подключение обработчика; запуск и остановка таймера. Используется в \ref using_basic и в примерах машины состояний.
|
||||
* **PIThread** — выполнение цикла или разовой работы в отдельном потоке. Переопределение \a run() или использование цикла по умолчанию; запуск и остановка — \a start() и \a stop(). Может быть исполнителем событий для \a PIObject (см. \ref using_advanced "Потоки и события").
|
||||
* **PITimer** — периодические вызовы с заданной частотой (например в Гц). Подключение обработчика; запуск и остановка таймера. Используется в \ref using_basic и в примерах машины состояний.
|
||||
* **Синхронизация** — \a PIMutex, \a PISpinlock, \a PIConditionVariable, \a PISemaphore, \a PIReadWriteLock для защиты общих данных и согласования потоков.
|
||||
* **\a PIThreadPoolExecutor** — отправка задач в пул рабочих потоков; ожидание завершения или остановка пула.
|
||||
* **\a PIThreadPoolLoop** — параллельный запуск функции по диапазону (стиль parallel-for).
|
||||
* **\a PIBlockingDequeue** — блокирующая очередь производитель–потребитель для передачи работы между потоками.
|
||||
* **PIThreadPoolExecutor** — отправка задач в пул рабочих потоков; ожидание завершения или остановка пула.
|
||||
* **PIThreadPoolLoop** — параллельный запуск функции по диапазону (стиль parallel-for).
|
||||
* **PIBlockingDequeue** — блокирующая очередь производитель–потребитель для передачи работы между потоками.
|
||||
|
||||
Для исключений-безопасной блокировки используйте \a PIMutexLocker и аналогичные охранные классы. События из других потоков можно ставить в очередь и обрабатывать в потоке объекта через \a callQueuedEvents() (см. \ref PIObject_sec0). Полный API: \a pithread.h, \a pitimer.h, \a pimutex.h, \a pithreadpoolexecutor.h, \a piblockingqueue.h, \a pithreadmodule.h.
|
||||
|
||||
18
main.cpp
18
main.cpp
@@ -20,7 +20,13 @@ inline PIByteArray SMBusTypeInfo_genHash(PIString n) {
|
||||
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
PICrypt _crypt;
|
||||
PIMathVectord v({1., 2., 3.});
|
||||
piCout << PIJSON::serialize(v);
|
||||
piCout << PIJSON::deserialize<PIMathVectorT2d>(PIJSON::serialize(v));
|
||||
// piCout << PIValueTreeConversions::toText(PIValueTreeConversions::fromTextFile("test_conf.conf"));
|
||||
|
||||
return 0;
|
||||
/*PICrypt _crypt;
|
||||
// auto ba = PIFile::readAll("logo.png");
|
||||
PIString str = "hello!"_a;
|
||||
PIByteArray ba = str.toAscii();
|
||||
@@ -79,7 +85,7 @@ int main(int argc, char * argv[]) {
|
||||
|
||||
piDeleteSafety(eth_r);
|
||||
piDeleteSafety(eth_s);
|
||||
return 0;
|
||||
return 0;*/
|
||||
|
||||
PITranslator::loadLang("ru");
|
||||
/*auto ucl = PIUnits::allClasses();
|
||||
@@ -104,7 +110,11 @@ int main(int argc, char * argv[]) {
|
||||
// for (int i = -10; i < 10; ++i)
|
||||
// piCout << PIUnits::Value(pow10(i * 0.99), PIUnits::Class::Distance::Meter).toString();
|
||||
|
||||
auto v = PIUnits::Value(M_PI, Angle::Radian);
|
||||
piCout << PIUnits::Value(1000, Mass::Gram).converted(Mass::Pound);
|
||||
piCout << PIUnits::Value(1000, Mass::Gram).converted(Mass::Ounce);
|
||||
|
||||
|
||||
/*auto v = PIUnits::Value(M_PI, Angle::Radian);
|
||||
piCout << v << "=" << v.converted(Angle::Degree);
|
||||
|
||||
v = PIUnits::Value(45, Angle::Degree);
|
||||
@@ -136,7 +146,7 @@ int main(int argc, char * argv[]) {
|
||||
piCout << PIUnits::Value(0.8, Time::Second).converted(Time::Hertz);
|
||||
piCout << PIUnits::Value(1.2, Time::Second).converted(Time::Hertz);
|
||||
piCout << PIUnits::Value(1001, Time::Second).converted(Time::Hertz);
|
||||
piCout << PIUnits::Value(1000001, Time::Second).converted(Time::Hertz);
|
||||
piCout << PIUnits::Value(1000001, Time::Second).converted(Time::Hertz);*/
|
||||
// piCout << PIUnits::Value(0.2, Time::Second).converted(Time::Hertz);
|
||||
// piCout << PIUnits::Value(5E-5, Time::Second).converted(Time::Hertz);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user