mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-16 21:20:05 +00:00
84c497292a
The old "Interface" class had a few problems such as using free functions (Which didn't allow you to write the service handler as if it were a regular class.) which weren't very extensible. (Only received one parameter with a pointer to the Interface object.) The new ServiceFramework aims to solve these problems by working with member functions and passing a generic context struct as parameter. This struct can be extended in the future without having to update all existing service implementations.
27 lines
849 B
C++
27 lines
849 B
C++
// 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"
|
|
#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) {
|
|
server_session->SetHleHandler(shared_from_this());
|
|
connected_sessions.push_back(server_session);
|
|
}
|
|
|
|
void SessionRequestHandler::ClientDisconnected(SharedPtr<ServerSession> server_session) {
|
|
server_session->SetHleHandler(nullptr);
|
|
boost::range::remove_erase(connected_sessions, server_session);
|
|
}
|
|
|
|
HLERequestContext::~HLERequestContext() = default;
|
|
|
|
} // namespace Kernel
|