pineapple-src/src/core/hle/kernel/client_session.h

69 lines
1.6 KiB
C
Raw Normal View History

2020-12-28 16:15:37 +01:00
// Copyright 2019 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include <string>
2020-12-31 11:03:11 +01:00
#include "core/hle/kernel/k_synchronization_object.h"
2020-12-28 16:15:37 +01:00
#include "core/hle/result.h"
union ResultCode;
namespace Core::Memory {
class Memory;
}
namespace Core::Timing {
class CoreTiming;
}
namespace Kernel {
class KernelCore;
class Session;
2021-01-22 01:15:25 +01:00
class KThread;
2020-12-28 16:15:37 +01:00
2020-12-31 11:03:11 +01:00
class ClientSession final : public KSynchronizationObject {
2020-12-28 16:15:37 +01:00
public:
explicit ClientSession(KernelCore& kernel);
~ClientSession() override;
friend class Session;
std::string GetTypeName() const override {
return "ClientSession";
}
std::string GetName() const override {
return name;
}
static constexpr HandleType HANDLE_TYPE = HandleType::ClientSession;
HandleType GetHandleType() const override {
return HANDLE_TYPE;
}
2021-01-22 01:15:25 +01:00
ResultCode SendSyncRequest(std::shared_ptr<KThread> thread, Core::Memory::Memory& memory,
2020-12-28 16:15:37 +01:00
Core::Timing::CoreTiming& core_timing);
bool IsSignaled() const override;
2021-01-22 01:15:25 +01:00
void Finalize() override {}
2020-12-28 16:15:37 +01:00
private:
static ResultVal<std::shared_ptr<ClientSession>> Create(KernelCore& kernel,
std::shared_ptr<Session> parent,
std::string name = "Unknown");
/// The parent session, which links to the server endpoint.
std::shared_ptr<Session> parent;
/// Name of the client session (optional)
std::string name;
};
} // namespace Kernel