diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-22 06:53:56 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-06 01:40:52 +0200 |
commit | 7a068641006da739d6af5681a022018785379365 (patch) | |
tree | aee13360312f8fb9ab9b64310cc478fcc6a5efb1 /src/core/hle/kernel/k_server_port.h | |
parent | hle: kernel: Migrate KClientPort to KAutoObject. (diff) | |
download | yuzu-7a068641006da739d6af5681a022018785379365.tar yuzu-7a068641006da739d6af5681a022018785379365.tar.gz yuzu-7a068641006da739d6af5681a022018785379365.tar.bz2 yuzu-7a068641006da739d6af5681a022018785379365.tar.lz yuzu-7a068641006da739d6af5681a022018785379365.tar.xz yuzu-7a068641006da739d6af5681a022018785379365.tar.zst yuzu-7a068641006da739d6af5681a022018785379365.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_server_port.h (renamed from src/core/hle/kernel/server_port.h) | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/k_server_port.h index f7d443df8..13fa54e5e 100644 --- a/src/core/hle/kernel/server_port.h +++ b/src/core/hle/kernel/k_server_port.h @@ -20,13 +20,17 @@ class KernelCore; class KServerSession; class SessionRequestHandler; -class ServerPort final : public KSynchronizationObject { +class KServerPort final : public KSynchronizationObject { + KERNEL_AUTOOBJECT_TRAITS(KServerPort, KSynchronizationObject); + public: - explicit ServerPort(KernelCore& kernel); - ~ServerPort() override; + explicit KServerPort(KernelCore& kernel); + virtual ~KServerPort() override; using HLEHandler = std::shared_ptr<SessionRequestHandler>; - using PortPair = std::pair<std::shared_ptr<ServerPort>, KClientPort*>; + using PortPair = std::pair<KServerPort*, KClientPort*>; + + void Initialize(std::string&& name_); /** * Creates a pair of ServerPort and an associated ClientPort. @@ -39,18 +43,6 @@ public: 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. @@ -79,9 +71,23 @@ public: /// waiting to be accepted by this port. void AppendPendingSession(KServerSession* pending_session); - bool IsSignaled() const override; + // Overridden virtual functions. + virtual void Destroy() override; + virtual bool IsSignaled() const override; + + // DEPRECATED - void Finalize() override {} + 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; + } private: /// ServerSessions waiting to be accepted by the port |