summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/time/local_system_clock_context_writer.h
blob: 1639ef2b9dfb6cde447c709368797a6376f077ea (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
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include "core/hle/service/time/system_clock_context_update_callback.h"
#include "core/hle/service/time/time_sharedmemory.h"

namespace Service::Time::Clock {

class LocalSystemClockContextWriter final : public SystemClockContextUpdateCallback {
public:
    explicit LocalSystemClockContextWriter(SharedMemory& shared_memory_)
        : SystemClockContextUpdateCallback{}, shared_memory{shared_memory_} {}

protected:
    Result Update() override {
        shared_memory.UpdateLocalSystemClockContext(context);
        return ResultSuccess;
    }

private:
    SharedMemory& shared_memory;
};

} // namespace Service::Time::Clock