本文整理汇总了C++中serializer::enter方法的典型用法代码示例。如果您正苦于以下问题:C++ serializer::enter方法的具体用法?C++ serializer::enter怎么用?C++ serializer::enter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类serializer
的用法示例。
在下文中一共展示了serializer::enter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serialize
void serialize(serializer &s, const std::string &key, const autocorr_result<T> &self)
{
internal::check_valid(self);
internal::serializer_sentry group(s, key);
// Write size and nlevel as 64-bit integers for consistency
serialize(s, "@size", static_cast<uint64_t>(self.size()));
serialize(s, "@nlevel", static_cast<uint64_t>(self.nlevel()));
s.enter("level");
for (size_t i = 0; i != self.nlevel(); ++i)
serialize(s, std::to_string(i), self.level_[i]);
s.exit();
s.enter("mean");
serialize(s, "value", self.mean());
serialize(s, "error", self.stderror());
s.exit();
}
示例2: serialize
void serialize(serializer &s, const std::string &key, const mean_result<T> &self)
{
internal::check_valid(self);
internal::serializer_sentry group(s, key);
// serialize to uint64_t to make sure we are consistent across 32/64 bit
serialize(s, "@size", static_cast<uint64_t>(self.store_->data_.size()));
serialize(s, "count", self.store_->count_);
s.enter("mean");
serialize(s, "value", self.store_->data_);
s.exit();
}