代码拉取完成,页面将自动刷新
## This file is a template. The comment below is emitted
## into the rendered file; feel free to edit this file.
// This file was auto generated. Do not edit.
#include "config.h"
#include <cereal/types/map.hpp>
#include <cereal/types/set.hpp>
#include <cereal/types/string.hpp>
#include <cereal/types/tuple.hpp>
#include <cereal/types/vector.hpp>
% for iface in interfaces:
#include <${iface.header()}>
% endfor
% for iface in interfaces:
<% properties = interface_composite.names(str(iface)) %>\
CEREAL_CLASS_VERSION(${iface.namespace()}, CLASS_VERSION);
% endfor
// Emitting signals prior to claiming a well known DBus service name causes
// un-necessary DBus traffic and wakeups. De-serialization only happens prior
// to claiming a well known name, so don't emit signals.
static constexpr auto skipSignals = true;
namespace cereal
{
// The version we started using cereal NVP from
static constexpr size_t CLASS_VERSION_WITH_NVP = 2;
% for iface in interfaces:
<% properties = interface_composite.names(str(iface)) %>\
template<class Archive>
void save(Archive& a,
const ${iface.namespace()}& object,
const std::uint32_t /* version */)
{
% for p in properties:
<% t = "cereal::make_nvp(\"" + p.CamelCase + "\", object." + p.camelCase + "())"
%>\
a(${t});
% endfor
}
template<class Archive>
void load(Archive& a,
${iface.namespace()}& object,
const std::uint32_t version)
{
% for p in properties:
<% t = "object." + p.camelCase + "()" %>\
decltype(${t}) ${p.CamelCase}{};
% endfor
if (version < CLASS_VERSION_WITH_NVP)
{
<%
props = ', '.join([p.CamelCase for p in properties])
%>\
a(${props});
}
else
{
% for p in properties:
<% t = "cereal::make_nvp(\"" + p.CamelCase + "\", " + p.CamelCase + ")" %>\
try
{
a(${t});
}
catch (const Exception &e)
{
// Ignore any exceptions, property value stays default
}
% endfor
}
% for p in properties:
<% t = "object." + p.camelCase + "(" + p.CamelCase + ", skipSignals)" %>\
${t};
% endfor
}
% endfor
} // namespace cereal
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。