summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/time/system_clock_context_update_callback.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-12-22 23:49:51 +0100
committerbunnei <bunneidev@gmail.com>2020-01-04 19:48:29 +0100
commit78f977c980e125e92b86261335447d0a254f18ee (patch)
treeeca0bcfdcabe32dd737fc545b1ce42395cdad2fc /src/core/hle/service/time/system_clock_context_update_callback.h
parentcore: Initialize several structs that make use of Common::UUID. (diff)
downloadyuzu-78f977c980e125e92b86261335447d0a254f18ee.tar
yuzu-78f977c980e125e92b86261335447d0a254f18ee.tar.gz
yuzu-78f977c980e125e92b86261335447d0a254f18ee.tar.bz2
yuzu-78f977c980e125e92b86261335447d0a254f18ee.tar.lz
yuzu-78f977c980e125e92b86261335447d0a254f18ee.tar.xz
yuzu-78f977c980e125e92b86261335447d0a254f18ee.tar.zst
yuzu-78f977c980e125e92b86261335447d0a254f18ee.zip
Diffstat (limited to 'src/core/hle/service/time/system_clock_context_update_callback.h')
-rw-r--r--src/core/hle/service/time/system_clock_context_update_callback.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/core/hle/service/time/system_clock_context_update_callback.h b/src/core/hle/service/time/system_clock_context_update_callback.h
new file mode 100644
index 000000000..6260de6c3
--- /dev/null
+++ b/src/core/hle/service/time/system_clock_context_update_callback.h
@@ -0,0 +1,43 @@
+// Copyright 2019 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include <vector>
+
+#include "core/hle/service/time/clock_types.h"
+
+namespace Kernel {
+class WritableEvent;
+}
+
+namespace Service::Time::Clock {
+
+// Parts of this implementation were based on Ryujinx (https://github.com/Ryujinx/Ryujinx/pull/783).
+// This code was released under public domain.
+
+class SystemClockContextUpdateCallback {
+public:
+ SystemClockContextUpdateCallback();
+ ~SystemClockContextUpdateCallback();
+
+ bool NeedUpdate(const SystemClockContext& value) const;
+
+ void RegisterOperationEvent(std::shared_ptr<Kernel::WritableEvent>&& writable_event);
+
+ void BroadcastOperationEvent();
+
+ ResultCode Update(const SystemClockContext& value);
+
+protected:
+ virtual ResultCode Update();
+
+ SystemClockContext context{};
+
+private:
+ bool has_context{};
+ std::vector<std::shared_ptr<Kernel::WritableEvent>> operation_event_list;
+};
+
+} // namespace Service::Time::Clock