mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-12 05:40:04 +00:00
Started IPC services serialization
This commit is contained in:
parent
7a5bde0b44
commit
ac0337d8df
8 changed files with 112 additions and 7 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <vector>
|
||||
#include "common/common_types.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/archives.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
|
@ -16,6 +17,8 @@
|
|||
#include "core/hle/service/ac/ac_u.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
SERIALIZE_EXPORT_IMPL(Service::AC::Module::Interface)
|
||||
|
||||
namespace Service::AC {
|
||||
void Module::Interface::CreateDefaultConfig(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx, 0x1, 0, 0);
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include "common/construct.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
|
@ -139,6 +142,34 @@ public:
|
|||
|
||||
protected:
|
||||
std::shared_ptr<Module> ac;
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
void save_construct(Archive& ar, const unsigned int file_version) const
|
||||
{
|
||||
ar << ac;
|
||||
ar << GetServiceName();
|
||||
ar << GetMaxSessions();
|
||||
}
|
||||
|
||||
template <class Archive>
|
||||
static void load_construct(Archive& ar, Interface* t, const unsigned int file_version)
|
||||
{
|
||||
std::shared_ptr<Module> ac;
|
||||
std::string name;
|
||||
u32 max_sessions;
|
||||
ar >> ac;
|
||||
ar >> name;
|
||||
ar >> max_sessions;
|
||||
::new(t)Interface(ac, name.c_str(), max_sessions);
|
||||
}
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int file_version)
|
||||
{
|
||||
ar & boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
|
||||
}
|
||||
BOOST_SERIALIZATION_FRIENDS
|
||||
};
|
||||
|
||||
protected:
|
||||
|
@ -153,8 +184,23 @@ protected:
|
|||
std::shared_ptr<Kernel::Event> close_event;
|
||||
std::shared_ptr<Kernel::Event> connect_event;
|
||||
std::shared_ptr<Kernel::Event> disconnect_event;
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int file_version)
|
||||
{
|
||||
ar & ac_connected;
|
||||
ar & close_event;
|
||||
ar & connect_event;
|
||||
ar & disconnect_event;
|
||||
// default_config is never written to
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
};
|
||||
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::AC
|
||||
|
||||
BOOST_SERIALIZATION_CONSTRUCT(Service::AC::Module::Interface)
|
||||
BOOST_CLASS_EXPORT_KEY(Service::AC::Module::Interface)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue