blob: f441670ec668c9f65bb1c29d330f32102587ccf6 [file] [log] [blame]
Deepak Kodihallif7b03992017-08-04 11:25:41 -05001## This file is a template. The comment below is emitted
2## into the rendered file; feel free to edit this file.
3// This file was auto generated. Do not edit.
4
5#include <cereal/types/string.hpp>
Brad Bishop1f4c70a2019-04-12 19:17:11 +00006#include <cereal/types/tuple.hpp>
Deepak Kodihallif7b03992017-08-04 11:25:41 -05007#include <cereal/types/vector.hpp>
Patrick Williams84b99d92020-10-14 10:09:31 -05008#include <cereal/types/map.hpp>
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +05309#include "config.h"
Deepak Kodihallif7b03992017-08-04 11:25:41 -050010% for iface in interfaces:
11#include <${iface.header()}>
12% endfor
13
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053014% for iface in interfaces:
15<% properties = interface_composite.names(str(iface)) %>\
16CEREAL_CLASS_VERSION(${iface.namespace()}, CLASS_VERSION);
17% endfor
18
Deepak Kodihallif7b03992017-08-04 11:25:41 -050019namespace cereal
20{
21
22% for iface in interfaces:
23<% properties = interface_composite.names(str(iface)) %>\
24template<class Archive>
25void save(Archive& a,
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053026 const ${iface.namespace()}& object,
27 const std::uint32_t version)
Deepak Kodihallif7b03992017-08-04 11:25:41 -050028{
29<%
Brad Bishop38646592019-04-12 18:05:45 +000030 props = ["object." + p.camelCase + "()" for p in properties]
Deepak Kodihallif7b03992017-08-04 11:25:41 -050031 props = ', '.join(props)
32%>\
33 a(${props});
34}
35
36
37template<class Archive>
38void load(Archive& a,
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053039 ${iface.namespace()}& object,
40 const std::uint32_t version)
Deepak Kodihallif7b03992017-08-04 11:25:41 -050041{
42% for p in properties:
Brad Bishop38646592019-04-12 18:05:45 +000043<% t = "object." + p.camelCase + "()" %>\
44 decltype(${t}) ${p.CamelCase}{};
Deepak Kodihallif7b03992017-08-04 11:25:41 -050045% endfor
46<%
Brad Bishop38646592019-04-12 18:05:45 +000047 props = ', '.join([p.CamelCase for p in properties])
Deepak Kodihallif7b03992017-08-04 11:25:41 -050048%>\
49 a(${props});
50% for p in properties:
Brad Bishop38646592019-04-12 18:05:45 +000051<% t = "object." + p.camelCase + "(" + p.CamelCase + ")" %>\
Deepak Kodihallif7b03992017-08-04 11:25:41 -050052 ${t};
53% endfor
54}
55
56% endfor
57} // namespace cereal