2017-01-05 04:23:17 +00:00
|
|
|
// Copyright 2017 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-03-23 21:09:02 +00:00
|
|
|
#include <memory>
|
2019-08-11 21:29:00 +00:00
|
|
|
#include <boost/serialization/access.hpp>
|
2018-08-02 02:40:00 +00:00
|
|
|
#include "core/hle/kernel/object.h"
|
2017-01-05 04:23:17 +00:00
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
|
|
class ClientSession;
|
|
|
|
class ClientPort;
|
|
|
|
class ServerSession;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parent structure to link the client and server endpoints of a session with their associated
|
|
|
|
* client port. The client port need not exist, as is the case for portless sessions like the
|
|
|
|
* FS File and Directory sessions. When one of the endpoints of a session is destroyed, its
|
|
|
|
* corresponding field in this structure will be set to nullptr.
|
|
|
|
*/
|
|
|
|
class Session final {
|
|
|
|
public:
|
2019-03-23 20:04:19 +00:00
|
|
|
ClientSession* client = nullptr; ///< The client endpoint of the session.
|
|
|
|
ServerSession* server = nullptr; ///< The server endpoint of the session.
|
|
|
|
std::shared_ptr<ClientPort> port; ///< The port that this session is associated with (optional).
|
2019-08-11 21:29:00 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
friend class boost::serialization::access;
|
|
|
|
template <class Archive>
|
|
|
|
void serialize(Archive& ar, const unsigned int file_version);
|
2017-01-05 04:23:17 +00:00
|
|
|
};
|
2018-03-09 17:54:43 +00:00
|
|
|
} // namespace Kernel
|