2020-03-31 16:54:28 +00:00
|
|
|
// Copyright 2020 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2019-12-22 18:35:03 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <boost/icl/discrete_interval.hpp>
|
2020-03-31 16:54:28 +00:00
|
|
|
#include "common/common_types.h"
|
2019-12-22 18:35:03 +00:00
|
|
|
|
|
|
|
namespace boost::serialization {
|
|
|
|
|
|
|
|
template <class Archive, class DomainT, ICL_COMPARE Compare>
|
2020-03-31 16:54:28 +00:00
|
|
|
void save(Archive& ar, const boost::icl::discrete_interval<DomainT, Compare>& obj,
|
|
|
|
const unsigned int file_version) {
|
2019-12-22 18:35:03 +00:00
|
|
|
ar << obj.lower();
|
|
|
|
ar << obj.upper();
|
|
|
|
ar << obj.bounds()._bits;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Archive, class DomainT, ICL_COMPARE Compare>
|
2020-03-31 16:54:28 +00:00
|
|
|
void load(Archive& ar, boost::icl::discrete_interval<DomainT, Compare>& obj,
|
|
|
|
const unsigned int file_version) {
|
2019-12-22 18:35:03 +00:00
|
|
|
DomainT upper, lower;
|
|
|
|
boost::icl::bound_type bounds;
|
|
|
|
ar >> lower;
|
2020-03-31 16:54:28 +00:00
|
|
|
ar >> upper;
|
2019-12-22 18:35:03 +00:00
|
|
|
ar >> bounds;
|
|
|
|
obj = boost::icl::discrete_interval(upper, lower, boost::icl::interval_bounds(bounds));
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Archive, class DomainT, ICL_COMPARE Compare>
|
2020-03-31 16:54:28 +00:00
|
|
|
void serialize(Archive& ar, boost::icl::discrete_interval<DomainT, Compare>& obj,
|
|
|
|
const unsigned int file_version) {
|
2019-12-22 18:35:03 +00:00
|
|
|
boost::serialization::split_free(ar, obj, file_version);
|
|
|
|
}
|
|
|
|
|
2020-03-31 16:54:28 +00:00
|
|
|
} // namespace boost::serialization
|