diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-08 08:30:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-08 08:30:17 +0200 |
commit | faa067f175cbf5e916ed75776817f0046e6731c4 (patch) | |
tree | 8ab02a72a6e4d6578848c8da2c02af02684aeec7 /src/core/hle/kernel/server_port.h | |
parent | Merge pull request #6287 from lioncash/ldr-copy (diff) | |
parent | hle: kernel: KPageTable: CanContain should not be constexpr. (diff) | |
download | yuzu-faa067f175cbf5e916ed75776817f0046e6731c4.tar yuzu-faa067f175cbf5e916ed75776817f0046e6731c4.tar.gz yuzu-faa067f175cbf5e916ed75776817f0046e6731c4.tar.bz2 yuzu-faa067f175cbf5e916ed75776817f0046e6731c4.tar.lz yuzu-faa067f175cbf5e916ed75776817f0046e6731c4.tar.xz yuzu-faa067f175cbf5e916ed75776817f0046e6731c4.tar.zst yuzu-faa067f175cbf5e916ed75776817f0046e6731c4.zip |
Diffstat (limited to 'src/core/hle/kernel/server_port.h')
-rw-r--r-- | src/core/hle/kernel/server_port.h | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h deleted file mode 100644 index 29b4f2509..000000000 --- a/src/core/hle/kernel/server_port.h +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2016 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include <memory> -#include <string> -#include <utility> -#include <vector> -#include "common/common_types.h" -#include "core/hle/kernel/k_synchronization_object.h" -#include "core/hle/kernel/object.h" -#include "core/hle/result.h" - -namespace Kernel { - -class ClientPort; -class KernelCore; -class ServerSession; -class SessionRequestHandler; - -class ServerPort final : public KSynchronizationObject { -public: - explicit ServerPort(KernelCore& kernel); - ~ServerPort() override; - - using HLEHandler = std::shared_ptr<SessionRequestHandler>; - using PortPair = std::pair<std::shared_ptr<ServerPort>, std::shared_ptr<ClientPort>>; - - /** - * Creates a pair of ServerPort and an associated ClientPort. - * - * @param kernel The kernel instance to create the port pair under. - * @param max_sessions Maximum number of sessions to the port - * @param name Optional name of the ports - * @return The created port tuple - */ - static PortPair CreatePortPair(KernelCore& kernel, u32 max_sessions, - std::string name = "UnknownPort"); - - std::string GetTypeName() const override { - return "ServerPort"; - } - std::string GetName() const override { - return name; - } - - static constexpr HandleType HANDLE_TYPE = HandleType::ServerPort; - HandleType GetHandleType() const override { - return HANDLE_TYPE; - } - - /** - * Accepts a pending incoming connection on this port. If there are no pending sessions, will - * return ERR_NO_PENDING_SESSIONS. - */ - ResultVal<std::shared_ptr<ServerSession>> Accept(); - - /// Whether or not this server port has an HLE handler available. - bool HasHLEHandler() const { - return hle_handler != nullptr; - } - - /// Gets the HLE handler for this port. - HLEHandler GetHLEHandler() const { - return hle_handler; - } - - /** - * Sets the HLE handler template for the port. ServerSessions crated by connecting to this port - * will inherit a reference to this handler. - */ - void SetHleHandler(HLEHandler hle_handler_) { - hle_handler = std::move(hle_handler_); - } - - /// Appends a ServerSession to the collection of ServerSessions - /// waiting to be accepted by this port. - void AppendPendingSession(std::shared_ptr<ServerSession> pending_session); - - bool IsSignaled() const override; - - void Finalize() override {} - -private: - /// ServerSessions waiting to be accepted by the port - std::vector<std::shared_ptr<ServerSession>> pending_sessions; - - /// This session's HLE request handler template (optional) - /// ServerSessions created from this port inherit a reference to this handler. - HLEHandler hle_handler; - - /// Name of the port (optional) - std::string name; -}; - -} // namespace Kernel |