blob: 5cf3c135600c5fbec3c941642aa4fc2a12115640 [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>
6#include <cereal/types/vector.hpp>
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +05307#include "config.h"
Deepak Kodihallif7b03992017-08-04 11:25:41 -05008% for iface in interfaces:
9#include <${iface.header()}>
10% endfor
11
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053012% for iface in interfaces:
13<% properties = interface_composite.names(str(iface)) %>\
14CEREAL_CLASS_VERSION(${iface.namespace()}, CLASS_VERSION);
15% endfor
16
Deepak Kodihallif7b03992017-08-04 11:25:41 -050017namespace cereal
18{
19
20% for iface in interfaces:
21<% properties = interface_composite.names(str(iface)) %>\
22template<class Archive>
23void save(Archive& a,
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053024 const ${iface.namespace()}& object,
25 const std::uint32_t version)
Deepak Kodihallif7b03992017-08-04 11:25:41 -050026{
27<%
28 props = ["object." + p[:1].lower() + p[1:] + "()" for p in properties]
29 props = ', '.join(props)
30%>\
31 a(${props});
32}
33
34
35template<class Archive>
36void load(Archive& a,
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053037 ${iface.namespace()}& object,
38 const std::uint32_t version)
Deepak Kodihallif7b03992017-08-04 11:25:41 -050039{
40% for p in properties:
41<% t = "object." + p[:1].lower() + p[1:] + "()" %>\
42 decltype(${t}) ${p}{};
43% endfor
44<%
45 props = ', '.join(properties)
46%>\
47 a(${props});
48% for p in properties:
49<% t = "object." + p[:1].lower() + p[1:] + "(" + p + ")" %>\
50 ${t};
51% endfor
52}
53
54% endfor
55} // namespace cereal