diff options
Diffstat (limited to 'src/core/hle/kernel/session.h')
| -rw-r--r-- | src/core/hle/kernel/session.h | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/core/hle/kernel/session.h b/src/core/hle/kernel/session.h deleted file mode 100644 index fa3c5651a..000000000 --- a/src/core/hle/kernel/session.h +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | // Copyright 2019 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <memory> | ||
| 8 | #include <string> | ||
| 9 | #include <utility> | ||
| 10 | |||
| 11 | #include "core/hle/kernel/k_synchronization_object.h" | ||
| 12 | |||
| 13 | namespace Kernel { | ||
| 14 | |||
| 15 | class ClientSession; | ||
| 16 | class ServerSession; | ||
| 17 | |||
| 18 | /** | ||
| 19 | * Parent structure to link the client and server endpoints of a session with their associated | ||
| 20 | * client port. | ||
| 21 | */ | ||
| 22 | class Session final : public KSynchronizationObject { | ||
| 23 | public: | ||
| 24 | explicit Session(KernelCore& kernel); | ||
| 25 | ~Session() override; | ||
| 26 | |||
| 27 | using SessionPair = std::pair<std::shared_ptr<ClientSession>, std::shared_ptr<ServerSession>>; | ||
| 28 | |||
| 29 | static SessionPair Create(KernelCore& kernel, std::string name = "Unknown"); | ||
| 30 | |||
| 31 | std::string GetName() const override { | ||
| 32 | return name; | ||
| 33 | } | ||
| 34 | |||
| 35 | static constexpr HandleType HANDLE_TYPE = HandleType::Session; | ||
| 36 | HandleType GetHandleType() const override { | ||
| 37 | return HANDLE_TYPE; | ||
| 38 | } | ||
| 39 | |||
| 40 | bool IsSignaled() const override; | ||
| 41 | |||
| 42 | void Finalize() override {} | ||
| 43 | |||
| 44 | std::shared_ptr<ClientSession> Client() { | ||
| 45 | if (auto result{client.lock()}) { | ||
| 46 | return result; | ||
| 47 | } | ||
| 48 | return {}; | ||
| 49 | } | ||
| 50 | |||
| 51 | std::shared_ptr<ServerSession> Server() { | ||
| 52 | if (auto result{server.lock()}) { | ||
| 53 | return result; | ||
| 54 | } | ||
| 55 | return {}; | ||
| 56 | } | ||
| 57 | |||
| 58 | private: | ||
| 59 | std::string name; | ||
| 60 | std::weak_ptr<ClientSession> client; | ||
| 61 | std::weak_ptr<ServerSession> server; | ||
| 62 | }; | ||
| 63 | |||
| 64 | } // namespace Kernel | ||