doc, small fixes

This commit is contained in:
2022-05-08 19:23:52 +03:00
parent 460519c075
commit 3107949e6f
24 changed files with 1061 additions and 406 deletions

View File

@@ -20,6 +20,46 @@
#include "pisingleapplication.h"
#include "pisharedmemory.h"
//! \class PISingleApplication pisingleapplication.h
//! \~\details
//! \~english
//!
//!
//! \~russian
//! Этот класс позволяет отслеживать повторный запуск приложения
//! и передавать сообщение первому запущеному.
//!
//! Видят друг друга %PISingleApplication с одинаковыми "app_name",
//! задаваемым в конструкторе.
//!
//! Если проверка \a isFirst() успешна, значит этот экземпляр
//! запущен первым, и можно соединиться к событию \a messageReceived().
//!
//! Если проверка провалена, значит этот экземпляр не первый,
//! и можно послать ему сообщение с помощью \a sendMessage(),
//! а затем выйти.
//!
//! \~\code
//! int main(int argc, char * argv[]) {
//! PISingleApplication sapp("myapp");
//! if (sapp.isFirst()) {
//! piCout << "I`m first, wait for another";
//! CONNECTL(&sapp, messageReceived, [](PIByteArray msg){
//! piCout << "Msg from another:" << PIString(msg);
//! });
//! } else {
//! piCout << "I`m not first, send and exit";
//! sapp.sendMessage(PIString("Hello!").toByteArray());
//! return 0;
//! }
//! WAIT_FOREVER
//! return 0;
//! }
//! \endcode
//!
#define SHM_SIZE 1024*32