Files
Lefucjusz 773f2c7eb1 [BH-2069] Update license URL in headers
Update outdated license file URL in
license headers across all project.
2024-09-18 11:53:01 +02:00

33 lines
994 B
C++

// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/blob/master/LICENSE.md
#pragma once
#include <chrono>
#include <functional>
namespace sys
{
class Timer; // Forward declaration
namespace timer
{
using TimerCallback = std::function<void(Timer &)>;
inline constexpr auto InfiniteTimeout = std::chrono::milliseconds::max();
enum class Type
{
Periodic,
SingleShot
};
} // namespace timer
class Timer
{
public:
virtual ~Timer() noexcept = default;
virtual void start() = 0;
virtual void restart(std::chrono::milliseconds newInterval) = 0;
virtual void stop() = 0;
virtual bool isActive() const noexcept = 0;
};
} // namespace sys