PITimer slot optimize
This commit is contained in:
@@ -126,13 +126,11 @@ public:
|
||||
|
||||
//! \~english Sets a tick callback that ignores the delimiter value.
|
||||
//! \~russian Устанавливает обратный вызов тика, игнорирующий значение делителя.
|
||||
void setSlot(std::function<void()> func) {
|
||||
ret_func = [func](int) { func(); };
|
||||
}
|
||||
void setSlot(std::function<void()> func) { ret_func = std::move(func); }
|
||||
|
||||
//! \~english Sets a tick callback that receives the current delimiter value.
|
||||
//! \~russian Устанавливает обратный вызов тика, принимающий текущее значение делителя.
|
||||
void setSlot(std::function<void(int)> func) { ret_func = func; }
|
||||
void setSlot(std::function<void(int)> func) { ret_func_delim = std::move(func); }
|
||||
|
||||
//! \~english Enables locking of the internal mutex around tick processing.
|
||||
//! \~russian Включает блокировку внутреннего мьютекса вокруг обработки тиков.
|
||||
@@ -245,7 +243,8 @@ protected:
|
||||
PIMutex mutex_;
|
||||
PISystemTime m_interval, m_interval_x5;
|
||||
PISystemTime m_time_next;
|
||||
std::function<void(int)> ret_func = nullptr;
|
||||
std::function<void()> ret_func = nullptr;
|
||||
std::function<void(int)> ret_func_delim = nullptr;
|
||||
PIVector<Delimiter> delims;
|
||||
PIConditionVariable event;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user