yuzu/src/core/hle/kernel/client_session.h

64 lines
1.5 KiB
C++
Raw Normal View History

// 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>
#include "core/hle/kernel/synchronization_object.h"
#include "core/hle/result.h"
union ResultCode;
namespace Memory {
class Memory;
}
namespace Kernel {
class KernelCore;
class Session;
class Thread;
class ClientSession final : public SynchronizationObject {
public:
explicit ClientSession(KernelCore& kernel);
~ClientSession() override;
friend class Session;
2016-12-01 04:28:31 +00:00
std::string GetTypeName() const override {
return "ClientSession";
}
2016-12-01 04:28:31 +00:00
std::string GetName() const override {
return name;
}
static constexpr HandleType HANDLE_TYPE = HandleType::ClientSession;
2016-12-01 04:28:31 +00:00
HandleType GetHandleType() const override {
return HANDLE_TYPE;
}
ResultCode SendSyncRequest(std::shared_ptr<Thread> thread, Memory::Memory& memory);
bool ShouldWait(const Thread* thread) const override;
void Acquire(Thread* thread) override;
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