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