2016-06-15 01:03:30 +02:00
|
|
|
// Copyright 2016 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-06-18 20:39:26 +02:00
|
|
|
#include <memory>
|
2016-12-14 18:33:49 +01:00
|
|
|
#include <string>
|
2019-08-11 23:29:00 +02:00
|
|
|
#include <boost/serialization/base_object.hpp>
|
|
|
|
#include <boost/serialization/export.hpp>
|
|
|
|
#include <boost/serialization/shared_ptr.hpp>
|
2016-06-15 01:03:30 +02:00
|
|
|
#include "common/common_types.h"
|
2018-08-02 04:40:00 +02:00
|
|
|
#include "core/hle/kernel/object.h"
|
2017-05-30 01:45:42 +02:00
|
|
|
#include "core/hle/result.h"
|
2016-06-15 01:03:30 +02:00
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
2017-01-05 05:23:17 +01:00
|
|
|
class Session;
|
2017-06-29 19:30:34 +02:00
|
|
|
class Thread;
|
2016-06-15 01:03:30 +02:00
|
|
|
|
|
|
|
class ClientSession final : public Object {
|
|
|
|
public:
|
2019-12-27 19:52:33 +01:00
|
|
|
explicit ClientSession(KernelSystem& kernel);
|
2019-03-23 21:04:19 +01:00
|
|
|
~ClientSession() override;
|
|
|
|
|
2018-10-13 22:11:20 +02:00
|
|
|
friend class KernelSystem;
|
2016-06-15 01:03:30 +02:00
|
|
|
|
2016-12-01 05:28:31 +01:00
|
|
|
std::string GetTypeName() const override {
|
|
|
|
return "ClientSession";
|
|
|
|
}
|
2016-12-05 17:02:08 +01:00
|
|
|
|
2016-12-01 05:28:31 +01:00
|
|
|
std::string GetName() const override {
|
|
|
|
return name;
|
|
|
|
}
|
2016-06-15 01:03:30 +02:00
|
|
|
|
2019-04-11 22:30:52 +02:00
|
|
|
static constexpr HandleType HANDLE_TYPE = HandleType::ClientSession;
|
2016-12-01 05:28:31 +01:00
|
|
|
HandleType GetHandleType() const override {
|
|
|
|
return HANDLE_TYPE;
|
|
|
|
}
|
2016-06-15 01:03:30 +02:00
|
|
|
|
|
|
|
/**
|
2016-12-05 17:02:08 +01:00
|
|
|
* Sends an SyncRequest from the current emulated thread.
|
2017-06-29 19:30:34 +02:00
|
|
|
* @param thread Thread that initiated the request.
|
2016-06-15 01:03:30 +02:00
|
|
|
* @return ResultCode of the operation.
|
|
|
|
*/
|
2019-03-23 21:04:19 +01:00
|
|
|
ResultCode SendSyncRequest(std::shared_ptr<Thread> thread);
|
2016-06-15 01:03:30 +02:00
|
|
|
|
2017-01-05 05:23:17 +01:00
|
|
|
std::string name; ///< Name of client port (optional)
|
|
|
|
|
|
|
|
/// The parent session, which links to the server endpoint.
|
|
|
|
std::shared_ptr<Session> parent;
|
2019-08-11 23:29:00 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
friend class boost::serialization::access;
|
|
|
|
template <class Archive>
|
|
|
|
void serialize(Archive& ar, const unsigned int file_version)
|
|
|
|
{
|
|
|
|
ar & boost::serialization::base_object<Object>(*this);
|
|
|
|
ar & name;
|
|
|
|
ar & parent;
|
|
|
|
}
|
2016-06-15 01:03:30 +02:00
|
|
|
};
|
|
|
|
|
2018-03-09 18:54:43 +01:00
|
|
|
} // namespace Kernel
|
2019-08-11 23:29:00 +02:00
|
|
|
|
|
|
|
BOOST_CLASS_EXPORT_KEY(Kernel::ClientSession)
|
2019-12-27 19:52:33 +01:00
|
|
|
CONSTRUCT_KERNEL_OBJECT(Kernel::ClientSession)
|