2014-04-16 03:28:03 +00:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-17 05:38:14 +00:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-04-16 03:28:03 +00:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2016-12-15 20:40:51 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-08-08 21:42:45 +00:00
|
|
|
#include <unordered_map>
|
2017-06-07 04:25:28 +00:00
|
|
|
#include "core/hle/kernel/kernel.h"
|
2014-04-16 03:28:03 +00:00
|
|
|
#include "core/hle/service/service.h"
|
|
|
|
|
2017-06-07 04:25:28 +00:00
|
|
|
namespace Kernel {
|
|
|
|
class HLERequestContext;
|
|
|
|
class Semaphore;
|
2018-03-09 17:54:43 +00:00
|
|
|
} // namespace Kernel
|
2017-06-07 04:25:28 +00:00
|
|
|
|
2018-09-22 12:23:08 +00:00
|
|
|
namespace Service::SM {
|
2014-04-16 03:28:03 +00:00
|
|
|
|
2014-04-17 00:46:05 +00:00
|
|
|
/// Interface to "srv:" service
|
2017-06-07 04:25:28 +00:00
|
|
|
class SRV final : public ServiceFramework<SRV> {
|
2014-04-16 03:28:03 +00:00
|
|
|
public:
|
2017-06-07 04:25:28 +00:00
|
|
|
explicit SRV(std::shared_ptr<ServiceManager> service_manager);
|
|
|
|
~SRV();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void RegisterClient(Kernel::HLERequestContext& ctx);
|
|
|
|
void EnableNotification(Kernel::HLERequestContext& ctx);
|
|
|
|
void GetServiceHandle(Kernel::HLERequestContext& ctx);
|
|
|
|
void Subscribe(Kernel::HLERequestContext& ctx);
|
|
|
|
void Unsubscribe(Kernel::HLERequestContext& ctx);
|
|
|
|
void PublishToSubscriber(Kernel::HLERequestContext& ctx);
|
2017-09-24 05:12:58 +00:00
|
|
|
void RegisterService(Kernel::HLERequestContext& ctx);
|
2014-04-16 03:28:03 +00:00
|
|
|
|
2017-06-07 04:25:28 +00:00
|
|
|
std::shared_ptr<ServiceManager> service_manager;
|
|
|
|
Kernel::SharedPtr<Kernel::Semaphore> notification_semaphore;
|
2018-08-08 21:42:45 +00:00
|
|
|
std::unordered_map<std::string, Kernel::SharedPtr<Kernel::Event>>
|
|
|
|
get_service_handle_delayed_map;
|
2014-04-16 03:28:03 +00:00
|
|
|
};
|
|
|
|
|
2018-09-22 12:23:08 +00:00
|
|
|
} // namespace Service::SM
|