blob: df49740dd3e2bfb0f1db0c116d670abde5d567de [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>
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +05308#include "config.h"
Deepak Kodihallif7b03992017-08-04 11:25:41 -05009% for iface in interfaces:
10#include <${iface.header()}>
11% endfor
12
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053013% for iface in interfaces:
14<% properties = interface_composite.names(str(iface)) %>\
15CEREAL_CLASS_VERSION(${iface.namespace()}, CLASS_VERSION);
16% endfor
17
Deepak Kodihallif7b03992017-08-04 11:25:41 -050018namespace cereal
19{
20
21% for iface in interfaces:
22<% properties = interface_composite.names(str(iface)) %>\
23template<class Archive>
24void save(Archive& a,
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053025 const ${iface.namespace()}& object,
26 const std::uint32_t version)
Deepak Kodihallif7b03992017-08-04 11:25:41 -050027{
28<%
Brad Bishop38646592019-04-12 18:05:45 +000029 props = ["object." + p.camelCase + "()" for p in properties]
Deepak Kodihallif7b03992017-08-04 11:25:41 -050030 props = ', '.join(props)
31%>\
32 a(${props});
33}
34
35
36template<class Archive>
37void load(Archive& a,
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053038 ${iface.namespace()}& object,
39 const std::uint32_t version)
Deepak Kodihallif7b03992017-08-04 11:25:41 -050040{
41% for p in properties:
Brad Bishop38646592019-04-12 18:05:45 +000042<% t = "object." + p.camelCase + "()" %>\
43 decltype(${t}) ${p.CamelCase}{};
Deepak Kodihallif7b03992017-08-04 11:25:41 -050044% endfor
45<%
Brad Bishop38646592019-04-12 18:05:45 +000046 props = ', '.join([p.CamelCase for p in properties])
Deepak Kodihallif7b03992017-08-04 11:25:41 -050047%>\
48 a(${props});
49% for p in properties:
Brad Bishop38646592019-04-12 18:05:45 +000050<% t = "object." + p.camelCase + "(" + p.CamelCase + ")" %>\
Deepak Kodihallif7b03992017-08-04 11:25:41 -050051 ${t};
52% endfor
53}
54
55% endfor
56} // namespace cereal