From dd8887c8cfbb6d3010dde240278a3d4018c5dd85 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 5 Dec 2016 11:02:08 -0500 Subject: KServerPorts now have an HLE handler "template", which is inherited by all ServerSessions created from it. --- src/core/hle/service/service.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/core/hle/service/service.h') diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 931512339..e85882713 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -176,7 +176,11 @@ namespace Service { static const int kMaxPortSize = 8; ///< Maximum size of a port name (8 characters) static const u32 DefaultMaxSessions = 10; ///< Arbitrary default number of maximum connections to an HLE port -/// TODO(Subv): Write documentation for this class +/** + * Interface implemented by HLE Session handlers. + * This can be provided to a ServerSession in order to hook into several relevant events (such as a new connection or a SyncRequest) + * so they can be implemented in the emulator. + */ class SessionRequestHandler { public: /** @@ -190,7 +194,9 @@ public: virtual ResultCode HandleSyncRequest(Kernel::SharedPtr server_session) = 0; }; -/// Interface to a CTROS service +/** + * Framework for implementing HLE service handlers which dispatch incoming SyncRequests based on a table mapping header ids to handler functions. + */ class Interface : public SessionRequestHandler { public: std::string GetName() const { @@ -257,9 +263,9 @@ void Init(); void Shutdown(); /// Map of named ports managed by the kernel, which can be retrieved using the ConnectToPort SVC. -extern std::unordered_map, std::shared_ptr>> g_kernel_named_ports; +extern std::unordered_map> g_kernel_named_ports; /// Map of services registered with the "srv:" service, retrieved using GetServiceHandle. -extern std::unordered_map, std::shared_ptr>> g_srv_services; +extern std::unordered_map> g_srv_services; /// Adds a service to the services table void AddService(Interface* interface_); -- cgit v1.2.3