mirror of
https://github.com/citra-emu/citra-canary.git
synced 2025-03-21 17:28:43 +00:00
34 lines
1.8 KiB
C++
34 lines
1.8 KiB
C++
// Copyright 2020 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <boost/serialization/serialization.hpp>
|
|
|
|
class construct_access {
|
|
public:
|
|
template <class Archive, class T>
|
|
static inline void save_construct(Archive& ar, const T* t, const unsigned int file_version) {
|
|
t->save_construct(ar, file_version);
|
|
}
|
|
template <class Archive, class T>
|
|
static inline void load_construct(Archive& ar, T* t, const unsigned int file_version) {
|
|
T::load_construct(ar, t, file_version);
|
|
}
|
|
};
|
|
|
|
#define BOOST_SERIALIZATION_CONSTRUCT(T) \
|
|
namespace boost { \
|
|
namespace serialization { \
|
|
template <class Archive> \
|
|
inline void save_construct_data(Archive& ar, const T* t, const unsigned int file_version) { \
|
|
construct_access::save_construct(ar, t, file_version); \
|
|
} \
|
|
template <class Archive> \
|
|
inline void load_construct_data(Archive& ar, T* t, const unsigned int file_version) { \
|
|
construct_access::load_construct(ar, t, file_version); \
|
|
} \
|
|
} \
|
|
}
|