blob: 9c6caf1964b2f67ca3377ec25f815983c1eefc36 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <memory>
#include <vector>
#include "core/hle/service/time/clock_types.h"
namespace Kernel {
class KWritableEvent;
}
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();
virtual ~SystemClockContextUpdateCallback();
bool NeedUpdate(const SystemClockContext& value) const;
void RegisterOperationEvent(std::shared_ptr<Kernel::KWritableEvent>&& writable_event);
void BroadcastOperationEvent();
Result Update(const SystemClockContext& value);
protected:
virtual Result Update();
SystemClockContext context{};
private:
bool has_context{};
std::vector<std::shared_ptr<Kernel::KWritableEvent>> operation_event_list;
};
} // namespace Service::Time::Clock
|