diff options
author | Lioncash <mathew1800@gmail.com> | 2019-03-11 15:28:16 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-03-11 15:41:05 +0100 |
commit | aa44eb639bd17b74a67cd614a0c329b4d8d61853 (patch) | |
tree | 17aaac37cd8aa703bdb2c3a76c1c276ef9c57aa3 /src/core/hle/kernel/server_port.h | |
parent | Merge pull request #2207 from lioncash/hwopus (diff) | |
download | yuzu-aa44eb639bd17b74a67cd614a0c329b4d8d61853.tar yuzu-aa44eb639bd17b74a67cd614a0c329b4d8d61853.tar.gz yuzu-aa44eb639bd17b74a67cd614a0c329b4d8d61853.tar.bz2 yuzu-aa44eb639bd17b74a67cd614a0c329b4d8d61853.tar.lz yuzu-aa44eb639bd17b74a67cd614a0c329b4d8d61853.tar.xz yuzu-aa44eb639bd17b74a67cd614a0c329b4d8d61853.tar.zst yuzu-aa44eb639bd17b74a67cd614a0c329b4d8d61853.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/server_port.h | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h index e52f8245f..9bc667cf2 100644 --- a/src/core/hle/kernel/server_port.h +++ b/src/core/hle/kernel/server_port.h @@ -22,6 +22,8 @@ class SessionRequestHandler; class ServerPort final : public WaitObject { public: + using HLEHandler = std::shared_ptr<SessionRequestHandler>; + /** * Creates a pair of ServerPort and an associated ClientPort. * @@ -51,22 +53,27 @@ public: */ ResultVal<SharedPtr<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(std::shared_ptr<SessionRequestHandler> hle_handler_) { + void SetHleHandler(HLEHandler hle_handler_) { hle_handler = std::move(hle_handler_); } - std::string name; ///< Name of port (optional) - - /// ServerSessions waiting to be accepted by the port - std::vector<SharedPtr<ServerSession>> pending_sessions; - - /// This session's HLE request handler template (optional) - /// ServerSessions created from this port inherit a reference to this handler. - std::shared_ptr<SessionRequestHandler> hle_handler; + /// Appends a ServerSession to the collection of ServerSessions + /// waiting to be accepted by this port. + void AppendPendingSession(SharedPtr<ServerSession> pending_session); bool ShouldWait(Thread* thread) const override; void Acquire(Thread* thread) override; @@ -74,6 +81,16 @@ public: private: explicit ServerPort(KernelCore& kernel); ~ServerPort() override; + + /// ServerSessions waiting to be accepted by the port + std::vector<SharedPtr<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 |