feat support default Timer::Ptr = nullptr
All checks were successful
linux-arm-gcc / linux-gcc-armhf (push) Successful in 1m59s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Successful in 2m3s
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 2m18s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Successful in 2m30s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 2m40s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Successful in 11m18s
All checks were successful
linux-arm-gcc / linux-gcc-armhf (push) Successful in 1m59s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Successful in 2m3s
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 2m18s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Successful in 2m30s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 2m40s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Successful in 11m18s
This commit is contained in:
parent
00e6e92041
commit
0990783878
@ -17,16 +17,17 @@ typedef uint32_t TimerGeneration;
|
|||||||
class Timer;
|
class Timer;
|
||||||
|
|
||||||
struct TimerThreadDeleter {
|
struct TimerThreadDeleter {
|
||||||
|
TimerThreadDeleter() = default;
|
||||||
TimerThreadDeleter(TaskQueueBase *owner);
|
TimerThreadDeleter(TaskQueueBase *owner);
|
||||||
inline void operator()(Timer *timer);
|
inline void operator()(Timer *timer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TaskQueueBase *owner_;
|
TaskQueueBase *owner_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Timer {
|
class Timer {
|
||||||
public:
|
public:
|
||||||
using Ptr= std::unique_ptr<Timer, TimerThreadDeleter>;
|
using Ptr = std::unique_ptr<Timer, TimerThreadDeleter>;
|
||||||
|
|
||||||
using OnExpired = std::function<sled::optional<DurationMs>()>;
|
using OnExpired = std::function<sled::optional<DurationMs>()>;
|
||||||
Timer(const Timer &) = delete;
|
Timer(const Timer &) = delete;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user