2017-06-05 00:52:19 -04:00
|
|
|
// Copyright 2017 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include <boost/range/algorithm_ext/erase.hpp>
|
|
|
|
#include "common/assert.h"
|
|
|
|
#include "common/common_types.h"
|
2017-06-09 02:55:18 -04:00
|
|
|
#include "core/hle/kernel/handle_table.h"
|
2017-06-05 00:52:19 -04:00
|
|
|
#include "core/hle/kernel/hle_ipc.h"
|
|
|
|
#include "core/hle/kernel/kernel.h"
|
|
|
|
#include "core/hle/kernel/server_session.h"
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
|
|
void SessionRequestHandler::ClientConnected(SharedPtr<ServerSession> server_session) {
|
2017-06-06 01:39:26 -04:00
|
|
|
server_session->SetHleHandler(shared_from_this());
|
2017-06-05 00:52:19 -04:00
|
|
|
connected_sessions.push_back(server_session);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SessionRequestHandler::ClientDisconnected(SharedPtr<ServerSession> server_session) {
|
2017-06-06 01:39:26 -04:00
|
|
|
server_session->SetHleHandler(nullptr);
|
2017-06-05 00:52:19 -04:00
|
|
|
boost::range::remove_erase(connected_sessions, server_session);
|
|
|
|
}
|
|
|
|
|
2017-06-07 00:20:52 -04:00
|
|
|
HLERequestContext::~HLERequestContext() = default;
|
|
|
|
|
2017-06-09 02:55:18 -04:00
|
|
|
SharedPtr<Object> HLERequestContext::GetIncomingHandle(Handle id_from_cmdbuf) const {
|
|
|
|
return Kernel::g_handle_table.GetGeneric(id_from_cmdbuf);
|
|
|
|
}
|
|
|
|
|
|
|
|
Handle HLERequestContext::AddOutgoingHandle(SharedPtr<Object> object) {
|
|
|
|
return Kernel::g_handle_table.Create(object).Unwrap();
|
|
|
|
}
|
|
|
|
|
2017-06-05 00:52:19 -04:00
|
|
|
} // namespace Kernel
|