mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-02 02:48:51 -05:00
Improve structure of the module sys. Problems within this module prevents from linking others. Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
35 lines
957 B
C++
35 lines
957 B
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include "Timer.hpp"
|
|
|
|
namespace sys
|
|
{
|
|
class TimerHandle : public Timer
|
|
{
|
|
public:
|
|
TimerHandle() noexcept = default;
|
|
explicit TimerHandle(Timer *timer) noexcept;
|
|
~TimerHandle() noexcept override;
|
|
|
|
TimerHandle(const TimerHandle &) = delete;
|
|
TimerHandle &operator=(const TimerHandle &) = delete;
|
|
|
|
TimerHandle(TimerHandle &&oth) noexcept;
|
|
TimerHandle &operator=(TimerHandle &&oth) noexcept;
|
|
|
|
bool isValid() const noexcept;
|
|
void reset(Timer *newTimer = nullptr) noexcept;
|
|
|
|
void start() override;
|
|
void restart(std::chrono::milliseconds newInterval) override;
|
|
void stop() override;
|
|
bool isActive() const noexcept override;
|
|
|
|
private:
|
|
Timer *timer = nullptr;
|
|
};
|
|
} // namespace sys
|