blob: bae2d334da5dc3185bc6b6adbbcf419bec25f8c4 [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
Brad Bishop23a8d932020-12-06 19:40:13 -050019// Emitting signals prior to claiming a well known DBus service name causes
20// un-necessary DBus traffic and wakeups. De-serialization only happens prior
21// to claiming a well known name, so don't emit signals.
22static constexpr auto skipSignals = true;
Deepak Kodihallif7b03992017-08-04 11:25:41 -050023namespace cereal
24{
25
26% for iface in interfaces:
27<% properties = interface_composite.names(str(iface)) %>\
28template<class Archive>
29void save(Archive& a,
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053030 const ${iface.namespace()}& object,
31 const std::uint32_t version)
Deepak Kodihallif7b03992017-08-04 11:25:41 -050032{
33<%
Brad Bishop38646592019-04-12 18:05:45 +000034 props = ["object." + p.camelCase + "()" for p in properties]
Deepak Kodihallif7b03992017-08-04 11:25:41 -050035 props = ', '.join(props)
36%>\
37 a(${props});
38}
39
40
41template<class Archive>
42void load(Archive& a,
Vishwanatha Subbanna2c4425e2017-09-29 22:53:53 +053043 ${iface.namespace()}& object,
44 const std::uint32_t version)
Deepak Kodihallif7b03992017-08-04 11:25:41 -050045{
46% for p in properties:
Brad Bishop38646592019-04-12 18:05:45 +000047<% t = "object." + p.camelCase + "()" %>\
48 decltype(${t}) ${p.CamelCase}{};
Deepak Kodihallif7b03992017-08-04 11:25:41 -050049% endfor
50<%
Brad Bishop38646592019-04-12 18:05:45 +000051 props = ', '.join([p.CamelCase for p in properties])
Deepak Kodihallif7b03992017-08-04 11:25:41 -050052%>\
53 a(${props});
54% for p in properties:
Brad Bishop23a8d932020-12-06 19:40:13 -050055<% t = "object." + p.camelCase + "(" + p.CamelCase + ", skipSignals)" %>\
Deepak Kodihallif7b03992017-08-04 11:25:41 -050056 ${t};
57% endfor
58}
59
60% endfor
61} // namespace cereal