PIEthernet more accuracy construct

PIThread windows fix
This commit is contained in:
2024-09-17 16:11:18 +03:00
parent e186e0adff
commit bdd18b614f
4 changed files with 30 additions and 16 deletions

View File

@@ -677,15 +677,28 @@ public:
//! \~\brief
//! \~english Destructor that executes the function if it exists
//! \~russian Деструктор, который выполняет функцию, если она существует
~PIScopeExitCall() {
if (func) func();
}
~PIScopeExitCall() { call(); }
//! \~\brief
//! \~english Method for canceling the function
//! \~russian Метод для отмены функции
void cancel() { func = nullptr; }
//! \~\brief
//! \~english Method for call the function
//! \~russian Метод для вызова функции
void call() {
if (func) func();
}
//! \~\brief
//! \~english Method for call and canceling the function
//! \~russian Метод для вызова и отмены функции
void callAndCancel() {
call();
cancel();
}
private:
NO_COPY_CLASS(PIScopeExitCall)