diff options
author | crupest <crupest@outlook.com> | 2019-04-10 19:42:46 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-10 19:42:46 +0800 |
commit | 7351020a582d70a1495249fba87d342c8a1fb634 (patch) | |
tree | e80f225041dc3816b3dce21c7e15aadbb211602e /src/platform_win/timer.hpp | |
parent | a94a806f69586e08a30fff0cdb3e52b0ce7acfa5 (diff) | |
download | cru-7351020a582d70a1495249fba87d342c8a1fb634.tar.gz cru-7351020a582d70a1495249fba87d342c8a1fb634.tar.bz2 cru-7351020a582d70a1495249fba87d342c8a1fb634.zip |
Refactor.
Diffstat (limited to 'src/platform_win/timer.hpp')
-rw-r--r-- | src/platform_win/timer.hpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/platform_win/timer.hpp b/src/platform_win/timer.hpp deleted file mode 100644 index 95468b8d..00000000 --- a/src/platform_win/timer.hpp +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once -#include "cru/platform/win/win_pre_config.hpp" - -#include <chrono> -#include <functional> -#include <map> -#include <optional> - -#include "cru/common/base.hpp" -#include "cru/platform/win/god_window.hpp" - -namespace cru::platform::win { -using TimerAction = std::function<void()>; - -class TimerManager : public Object { - public: - TimerManager(GodWindow* god_window); - TimerManager(const TimerManager& other) = delete; - TimerManager(TimerManager&& other) = delete; - TimerManager& operator=(const TimerManager& other) = delete; - TimerManager& operator=(TimerManager&& other) = delete; - ~TimerManager() override = default; - - UINT_PTR CreateTimer(UINT milliseconds, bool loop, const TimerAction& action); - void KillTimer(UINT_PTR id); - std::optional<std::pair<bool, TimerAction>> GetAction(UINT_PTR id); - - private: - GodWindow* god_window_; - - std::map<UINT_PTR, std::pair<bool, TimerAction>> map_{}; - UINT_PTR current_count_ = 0; -}; -} // namespace cru::platform::win |