APT service serialization

This commit is contained in:
Hamish Milne 2019-12-25 21:43:51 +00:00 committed by zhupengfei
parent 3e752002c4
commit 5265c79056
25 changed files with 247 additions and 17 deletions

View file

@ -199,7 +199,7 @@ extern const std::array<ServiceModuleInfo, 40> service_module_map;
} // namespace Service
#define SERVICE_SERIALIZATION(T, MFIELD) \
#define SERVICE_SERIALIZATION(T, MFIELD, TMODULE) \
template <class Archive> \
void save_construct(Archive& ar, const unsigned int file_version) const \
{ \
@ -209,7 +209,7 @@ extern const std::array<ServiceModuleInfo, 40> service_module_map;
template <class Archive> \
static void load_construct(Archive& ar, T* t, const unsigned int file_version) \
{ \
std::shared_ptr<Module> MFIELD; \
std::shared_ptr<TMODULE> MFIELD; \
ar >> MFIELD; \
::new(t)T(MFIELD); \
} \